<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>qem-manual(使用手册) | 个人博客 | 一个coder的成长记录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="Oracle,PLSQL,qem">
    <meta name="description" content="qem-manual(使用手册) q$error_manager使用手册 (DBMS_UTILITY.format_error_backtrace()也挺好用)  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455SELECT * FROM q$l">
<meta name="keywords" content="Oracle,PLSQL,qem">
<meta property="og:type" content="article">
<meta property="og:title" content="qem-manual(使用手册)">
<meta property="og:url" content="https://betgar.github.io/2018/04/17/qem-manual/index.html">
<meta property="og:site_name" content="个人博客">
<meta property="og:description" content="qem-manual(使用手册) q$error_manager使用手册 (DBMS_UTILITY.format_error_backtrace()也挺好用)  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455SELECT * FROM q$l">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-04-12T09:42:14.470Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="qem-manual(使用手册)">
<meta name="twitter:description" content="qem-manual(使用手册) q$error_manager使用手册 (DBMS_UTILITY.format_error_backtrace()也挺好用)  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455SELECT * FROM q$l">
    
        <link rel="alternate" type="application/atom+xml" title="个人博客" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide">
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">俊男</h5>
          <a href="mailto:betgar@163.com" title="betgar@163.com" class="mail">betgar@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/">
                <i class="icon icon-lg icon-home"></i>
                Home
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives">
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags">
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories">
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/betgar" target="_blank">
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://weibo.com/u/2296734915" target="_blank">
                <i class="icon icon-lg icon-weibo"></i>
                Weibo
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about">
                <i class="icon icon-lg icon-link"></i>
                About
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">qem-manual(使用手册)</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">qem-manual(使用手册)</h1>
        <h5 class="subtitle">
            
                <time datetime="2018-04-17T12:00:00.000Z" itemprop="datePublished" class="page-time">
  2018-04-17
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/Oracle/">Oracle</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#qem-manual-使用手册"><span class="post-toc-number">1.</span> <span class="post-toc-text">qem-manual(使用手册)</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Usage"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">Usage</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#register-error"><span class="post-toc-number">1.1.1.</span> <span class="post-toc-text">register_error</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#trace-logging-with-multiple-contexts"><span class="post-toc-number">1.1.2.</span> <span class="post-toc-text">trace logging with multiple contexts</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#discard-error-state"><span class="post-toc-number">1.1.3.</span> <span class="post-toc-text">discard_error_state</span></a></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#q-error-manager安装"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">q$error_manager安装</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#q-error-manager包声明"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">q$error_manager包声明</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#q-error-manager包体"><span class="post-toc-number">1.4.</span> <span class="post-toc-text">q$error_manager包体</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#自定义错误"><span class="post-toc-number">1.5.</span> <span class="post-toc-text">自定义错误</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#卸载"><span class="post-toc-number">1.6.</span> <span class="post-toc-text">卸载</span></a></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-qem-manual" class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">qem-manual(使用手册)</h1>
        <div class="post-meta">
            <time class="post-time" title="2018-04-17 20:00:00" datetime="2018-04-17T12:00:00.000Z" itemprop="datePublished">2018-04-17</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/Oracle/">Oracle</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style="display:none">
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h1 id="qem-manual-使用手册"><a href="#qem-manual-使用手册" class="headerlink" title="qem-manual(使用手册)"></a>qem-manual(使用手册)</h1><blockquote>
<p>q$error_manager使用手册</p>
<p>(DBMS_UTILITY.format_error_backtrace()也挺好用)</p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> * <span class="keyword">FROM</span> q$<span class="keyword">log</span>;</span><br><span class="line"><span class="keyword">SELECT</span> * <span class="keyword">FROM</span> q$<span class="keyword">error</span>;</span><br><span class="line"><span class="keyword">SELECT</span> * <span class="keyword">FROM</span> q$error_context;</span><br><span class="line"><span class="keyword">SELECT</span> * <span class="keyword">FROM</span> q$error_instance;</span><br><span class="line"></span><br><span class="line"><span class="keyword">DELETE</span> <span class="keyword">FROM</span> q$error_instance;</span><br><span class="line"><span class="keyword">DELETE</span> <span class="keyword">FROM</span> q$<span class="keyword">error</span>;</span><br><span class="line"><span class="comment">--------------------------</span></span><br><span class="line"><span class="comment">-- q$error_manager install</span></span><br><span class="line"><span class="comment">-- 执行qem$install.sql</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-------------------------</span></span><br><span class="line"><span class="comment">-- q$error_manager.pks</span></span><br><span class="line"><span class="comment">-- q$error_manager.pkb</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 清空q$log</span></span><br><span class="line"><span class="keyword">CALL</span> q$error_manager.clear_trace();</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查询trace</span></span><br><span class="line"><span class="keyword">CALL</span> q$error_manager.show_trace(from_id_in =&gt; <span class="literal">NULL</span>, context_like_in =&gt; <span class="string">'km_sum_with_obj'</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">-- A查询</span></span><br><span class="line"><span class="keyword">CALL</span> q$error_manager.show_trace(from_id_in =&gt; <span class="literal">NULL</span>, context_like_in =&gt; <span class="string">'km_sum_with_obj'</span>, text_like_in =&gt; <span class="string">'XTCACMERGEDATA'</span>);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 等价A查询</span></span><br><span class="line"><span class="keyword">SELECT</span> * <span class="keyword">FROM</span> q$<span class="keyword">log</span> l <span class="keyword">WHERE</span> l.context <span class="keyword">LIKE</span> <span class="string">'%km_sum_with_obj'</span> <span class="keyword">AND</span> l.text <span class="keyword">LIKE</span> <span class="string">'%XTCACMERGEDATA%'</span> <span class="keyword">ORDER</span> <span class="keyword">BY</span> l.ID;</span><br><span class="line"></span><br><span class="line">execsql;</span><br><span class="line"><span class="comment">------------</span></span><br><span class="line"><span class="comment">-- 跟踪代码</span></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">IF NOT q$error_manager.trace_enabled(context_in =&gt; 'km_sum_with_obj') THEN</span></span><br><span class="line"><span class="comment">			q$error_manager.trace_on(context_like_in =&gt; 'km_sum_with_obj');</span></span><br><span class="line"><span class="comment">END IF;</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">---------</span></span><br><span class="line"><span class="comment">-- 记录</span></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">IF q$error_manager.trace_enabled('km_sum_with_obj') THEN</span></span><br><span class="line"><span class="comment">		q$error_manager.trace(context_in =&gt; 'km_sum_with_obj',text_in =&gt; V_SQLSTRING);</span></span><br><span class="line"><span class="comment">END IF;</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-----------</span></span><br><span class="line"><span class="comment">-- 记录错误</span></span><br><span class="line">q$error_manager.error_trace_on();</span><br><span class="line">q$error_manager.register_error(error_code_in =&gt; SQLCODE, </span><br><span class="line">		error_instance_id_out =&gt; error_instance_id, </span><br><span class="line">		text_in =&gt; dbms_utility.format_error_backtrace);	</span><br><span class="line">q$error_manager.error_trace_off();</span><br></pre></td></tr></table></figure>
<h2 id="Usage"><a href="#Usage" class="headerlink" title="Usage"></a>Usage</h2><h3 id="register-error"><a href="#register-error" class="headerlink" title="register_error"></a>register_error</h3><blockquote>
<p><code>qem_demo_register_error.sql</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   <span class="keyword">DELETE</span> <span class="keyword">FROM</span> q$error_instance;</span><br><span class="line"></span><br><span class="line">   FOR rec IN (<span class="keyword">SELECT</span> *</span><br><span class="line">                 <span class="keyword">FROM</span> employees)</span><br><span class="line">   <span class="keyword">LOOP</span></span><br><span class="line">      DBMS_OUTPUT.put_line (rec.last_name);</span><br><span class="line">      q$error_manager.register_error (error_name_in      =&gt; 'UNANTICIPATED-ERROR'</span><br><span class="line">                                    , text_in            =&gt;    'My message here: '</span><br><span class="line">                                                            || rec.last_name</span><br><span class="line">                                    , name1_in           =&gt; 'FIRSTNAME'</span><br><span class="line">                                    , value1_in          =&gt; rec.first_name</span><br><span class="line">                                     );</span><br><span class="line">      q$error_manager.mark_q$error_handled;</span><br><span class="line">   <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line"></span><br><span class="line">   <span class="keyword">COMMIT</span>;</span><br><span class="line"><span class="keyword">END</span>;</span><br></pre></td></tr></table></figure>
<h3 id="trace-logging-with-multiple-contexts"><a href="#trace-logging-with-multiple-contexts" class="headerlink" title="trace logging with multiple contexts"></a>trace logging with multiple contexts</h3><blockquote>
<p><code>qem_demo_mult_contexts.sql</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">Test the trace logging with multiple contexts</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">PROCEDURE</span> dept_sal (department_id_in <span class="keyword">IN</span> PLS_INTEGER)</span><br><span class="line"><span class="keyword">IS</span></span><br><span class="line">   l_max_salary   <span class="built_in">NUMBER</span>;</span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   <span class="keyword">IF</span> q$error_manager.trace_enabled(<span class="string">'context1'</span>)</span><br><span class="line">   <span class="keyword">THEN</span></span><br><span class="line">      q$error_manager.trace (<span class="string">'context1'</span>, department_id_in);</span><br><span class="line">   <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">   l_max_salary := CASE WHEN department_id_in &gt; 100 THEN 10000 ELSE 20000 END;</span><br><span class="line"></span><br><span class="line">   IF q$error_manager.trace_enabled('context2')</span><br><span class="line">   THEN</span><br><span class="line">      q$error_manager.trace ('context2', l_max_salary);</span><br><span class="line">   <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"><span class="keyword">END</span> dept_sal;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   q$error_manager.trace_on (<span class="string">'context2,context1'</span>);</span><br><span class="line">   q$error_manager.toscreen;</span><br><span class="line"><span class="comment">-- or use q$error_manager.totable so the output is writed to the q$log table</span></span><br><span class="line">   </span><br><span class="line">   dept_sal (50);</span><br><span class="line">   dept_sal (200);</span><br><span class="line"></span><br><span class="line">   IF q$error_manager.trace_enabled('context3')</span><br><span class="line">   THEN</span><br><span class="line">      q$error_manager.trace ('context3', 'All done!');</span><br><span class="line">   <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br></pre></td></tr></table></figure>
<h3 id="discard-error-state"><a href="#discard-error-state" class="headerlink" title="discard_error_state"></a>discard_error_state</h3><blockquote>
<p><code>qem_demo_discard_error_state.sql</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* </span></span><br><span class="line"><span class="comment">Raise and propagate an Oracle error, then</span></span><br><span class="line"><span class="comment">trap that error and extract information about the error.</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">PROCEDURE</span> dept_sal (department_id_in <span class="keyword">IN</span> PLS_INTEGER)</span><br><span class="line"><span class="keyword">IS</span></span><br><span class="line">   l_max_salary   <span class="built_in">NUMBER</span>;</span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   l_max_salary := <span class="keyword">CASE</span> <span class="keyword">WHEN</span> department_id_in &gt; <span class="number">100</span> <span class="keyword">THEN</span> <span class="number">10000</span> <span class="keyword">ELSE</span> <span class="number">20000</span> <span class="keyword">END</span>;</span><br><span class="line"></span><br><span class="line">   <span class="keyword">BEGIN</span></span><br><span class="line">      <span class="keyword">IF</span> l_max_salary = <span class="number">10000</span></span><br><span class="line">      <span class="keyword">THEN</span></span><br><span class="line">         DBMS_OUTPUT.put_line (<span class="string">'Raising DUP_VAL_ON_INDEX'</span>);</span><br><span class="line">         RAISE DUP_VAL_ON_INDEX;</span><br><span class="line">      ELSE</span><br><span class="line">         DBMS_OUTPUT.put_line ('Raising NO_DATA_FOUND');</span><br><span class="line">         RAISE NO_DATA_FOUND;</span><br><span class="line">      <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">   EXCEPTION</span><br><span class="line">      WHEN OTHERS</span><br><span class="line">      THEN</span><br><span class="line">         <span class="comment">/* Trap the error, add some context, pass it along. */</span></span><br><span class="line">         q$error_manager.raise_unanticipated (name1_in    =&gt; 'DEPARTMENT ID'</span><br><span class="line">                                            , value1_in   =&gt; department_id_in</span><br><span class="line">                                            , name2_in    =&gt; 'MAX SALARY'</span><br><span class="line">                                            , value2_in   =&gt; l_max_salary</span><br><span class="line">                                            , name3_in    =&gt; 'TABLE_NAME'</span><br><span class="line">                                            , value3_in   =&gt; 'DEPARTMENTS'</span><br><span class="line">                                            , name4_in    =&gt; 'OWNER'</span><br><span class="line">                                            , value4_in   =&gt; USER</span><br><span class="line">                                             );</span><br><span class="line">   <span class="keyword">END</span>;</span><br><span class="line">EXCEPTION</span><br><span class="line">   WHEN OTHERS</span><br><span class="line">   THEN</span><br><span class="line">      DBMS_OUTPUT.put_line (DBMS_UTILITY.format_error_stack);</span><br><span class="line"><span class="keyword">END</span> dept_sal;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   DBMS_OUTPUT.put_line (<span class="string">'Keep Error State:'</span>);</span><br><span class="line">   q$error_manager.keep_error_state;</span><br><span class="line"></span><br><span class="line">   dept_sal (50);</span><br><span class="line">   dept_sal (200);</span><br><span class="line">   DBMS_OUTPUT.put_line ('Discard Error State:');</span><br><span class="line"></span><br><span class="line">   q$error_manager.discard_error_state;</span><br><span class="line">   dept_sal (50);</span><br><span class="line">   dept_sal (200);</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br></pre></td></tr></table></figure>
<h2 id="q-error-manager安装"><a href="#q-error-manager安装" class="headerlink" title="q$error_manager安装"></a>q$error_manager安装</h2><blockquote>
<p><code>qem$install.sql</code>文件</p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">| This program is a part of the Quest Error Manager for Oracle.</span></span><br><span class="line"><span class="comment">| This product is freeware and is not supported by Quest.</span></span><br><span class="line"><span class="comment">| </span></span><br><span class="line"><span class="comment">| www.quest.com</span></span><br><span class="line"><span class="comment">| </span></span><br><span class="line"><span class="comment">| Copyright, Quest Software, Inc, 2007</span></span><br><span class="line"><span class="comment">| All rights reserved</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">?2008 Quest Software, Inc.</span></span><br><span class="line"><span class="comment">ALL RIGHTS RESERVED.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Redistribution and use of the Quest Error Manager for Oracle software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">1.    Redistributions of source code must retain (i) the following copyright notice: "?008 Quest Software, Inc. All rights reserved," (ii) this list of conditions, and (iii) the disclaimer below. </span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">2.    Redistributions in binary form must reproduce (i) the following copyright notice: "?008 Quest Software, Inc. All rights reserved," (ii) this list of conditions, and (iii) the disclaimer below, in the documentation and/or other materials provided with the distribution. </span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">3.    All advertising materials mentioning features or use of the Quest Error Manager for Oracle software must display the following acknowledgement: </span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">This product includes software developed by Quest Software, Inc. and its contributors.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">4.    Neither the name of Quest Software, Inc. nor the name its affiliates, subsidiaries or contributors may be used to endorse or promote products derived from the Quest Error Manager for Oracle software without specific prior written permission from Quest Software, Inc. </span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Disclaimer:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">THIS SOFTWARE IS PROVIDED BY QUEST SOFTWARE, INC. AND ITS CONTRIBUTORS ``AS IS'' </span></span><br><span class="line"><span class="comment">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, </span></span><br><span class="line"><span class="comment">THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, </span></span><br><span class="line"><span class="comment">AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL QUEST SOFTWARE OR ITS </span></span><br><span class="line"><span class="comment">CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, </span></span><br><span class="line"><span class="comment">OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE </span></span><br><span class="line"><span class="comment">GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) </span></span><br><span class="line"><span class="comment">HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, </span></span><br><span class="line"><span class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE </span></span><br><span class="line"><span class="comment">QUEST ERROR MANAGER SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line">SPOOL qem$install.log</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">SEQUENCE</span> q$error_seq</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">SEQUENCE</span> q$log_seq</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">SEQUENCE</span> q$error_context_seq</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">SEQUENCE</span> q$error_instance_seq</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> q$error_context</span><br><span class="line">(</span><br><span class="line">   <span class="keyword">id</span>                  <span class="built_in">INTEGER</span></span><br><span class="line"> , error_instance_id   <span class="built_in">INTEGER</span></span><br><span class="line"> , <span class="keyword">name</span>                VARCHAR2 (<span class="number">500</span>) <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line"> , <span class="keyword">VALUE</span>               VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , created_on          <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , created_by          VARCHAR2 (<span class="number">100</span>)</span><br><span class="line"> , changed_on          <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , changed_by          VARCHAR2 (<span class="number">100</span>)</span><br><span class="line">)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.3 If QEM is already installed, use the alter statements to </span></span><br><span class="line"><span class="comment">         change the datatypes */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_context <span class="keyword">MODIFY</span> (created_on <span class="keyword">TIMESTAMP</span>, changed_on <span class="keyword">TIMESTAMP</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">COMMENT</span> <span class="keyword">ON</span> <span class="keyword">TABLE</span> q$error_context <span class="keyword">IS</span></span><br><span class="line"><span class="string">'Actual value for the named context for a given error instance.'</span></span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> q$<span class="keyword">error</span></span><br><span class="line">(</span><br><span class="line">   <span class="keyword">id</span>                    <span class="built_in">INTEGER</span></span><br><span class="line"> , error_category_name   VARCHAR2 (<span class="number">500</span>)</span><br><span class="line"> , code                  <span class="built_in">INTEGER</span></span><br><span class="line"> , <span class="keyword">name</span>                  VARCHAR2 (<span class="number">500</span>)</span><br><span class="line"> , description           VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , substitute_string     VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , recommendation        VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , created_on            <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , created_by            VARCHAR2 (<span class="number">100</span>)</span><br><span class="line"> , changed_on            <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , changed_by            VARCHAR2 (<span class="number">100</span>)</span><br><span class="line">)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.3 If QEM is already installed, use the alter statements to </span></span><br><span class="line"><span class="comment">         change the datatypes */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$<span class="keyword">error</span> <span class="keyword">MODIFY</span> (created_on <span class="keyword">TIMESTAMP</span>, changed_on <span class="keyword">TIMESTAMP</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">COMMENT</span> <span class="keyword">ON</span> <span class="keyword">TABLE</span> q$<span class="keyword">error</span> <span class="keyword">IS</span></span><br><span class="line"><span class="string">'The set of pre-defined errors copied from sa_error when app was deployed'</span></span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> q$error_instance</span><br><span class="line">(</span><br><span class="line">   <span class="keyword">id</span>                     <span class="built_in">INTEGER</span></span><br><span class="line"> , error_id               <span class="built_in">INTEGER</span></span><br><span class="line"> , error_stack            VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , call_stack             VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , MESSAGE                VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , system_error_code      <span class="built_in">INTEGER</span></span><br><span class="line"> , system_error_message   VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , environment_info       VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , created_on             <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , created_by             VARCHAR2 (<span class="number">100</span>)</span><br><span class="line"> , changed_on             <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , changed_by             VARCHAR2 (<span class="number">100</span>)</span><br><span class="line">)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.3 If QEM is already installed, use the alter statements to </span></span><br><span class="line"><span class="comment">         change the datatypes */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_instance <span class="keyword">MODIFY</span> (created_on <span class="keyword">TIMESTAMP</span>, changed_on <span class="keyword">TIMESTAMP</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">COMMENT</span> <span class="keyword">ON</span> <span class="keyword">TABLE</span> q$error_instance <span class="keyword">IS</span></span><br><span class="line"><span class="string">'A particular instance of an error that occurs in the application'</span></span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> q$<span class="keyword">log</span></span><br><span class="line">(</span><br><span class="line">   <span class="keyword">id</span>           <span class="built_in">INTEGER</span></span><br><span class="line"> , <span class="keyword">context</span>      VARCHAR2 (<span class="number">500</span>)</span><br><span class="line"> , <span class="built_in">text</span>         VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , call_stack   VARCHAR2 (<span class="number">4000</span>)</span><br><span class="line"> , created_on   <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , created_by   VARCHAR2 (<span class="number">100</span>)</span><br><span class="line"> , changed_on   <span class="keyword">TIMESTAMP</span></span><br><span class="line"> , changed_by   VARCHAR2 (<span class="number">100</span>)</span><br><span class="line">)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.3 If QEM is already installed, use the alter statements to </span></span><br><span class="line"><span class="comment">         change the datatypes */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$<span class="keyword">log</span> <span class="keyword">MODIFY</span> (created_on <span class="keyword">TIMESTAMP</span>, changed_on <span class="keyword">TIMESTAMP</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$error_context_un</span><br><span class="line">   <span class="keyword">ON</span> q$error_context (error_instance_id, <span class="keyword">name</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$error_context_pk</span><br><span class="line">   <span class="keyword">ON</span> q$error_context (<span class="keyword">id</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$error_pk</span><br><span class="line">   <span class="keyword">ON</span> q$<span class="keyword">error</span> (<span class="keyword">id</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$error_code_pk</span><br><span class="line">   <span class="keyword">ON</span> q$<span class="keyword">error</span> (code)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$error_instance_pk</span><br><span class="line">   <span class="keyword">ON</span> q$error_instance (<span class="keyword">id</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">UNIQUE</span> <span class="keyword">INDEX</span> q$log_pk</span><br><span class="line">   <span class="keyword">ON</span> q$<span class="keyword">log</span> (<span class="keyword">id</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_context <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$error_context_pk PRIMARY <span class="keyword">KEY</span> (<span class="keyword">id</span>))</span><br><span class="line">/</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$<span class="keyword">error</span> <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$error_pk PRIMARY <span class="keyword">KEY</span> (<span class="keyword">id</span>))</span><br><span class="line">/</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_instance <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$error_instance_pk PRIMARY <span class="keyword">KEY</span> (<span class="keyword">id</span>))</span><br><span class="line">/</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$<span class="keyword">log</span> <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$log_pk PRIMARY <span class="keyword">KEY</span> (<span class="keyword">id</span>))</span><br><span class="line">/</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_context <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$error_context_errinst_fk FOREIGN <span class="keyword">KEY</span> (error_instance_id)</span><br><span class="line">    <span class="keyword">REFERENCES</span> q$error_instance (<span class="keyword">id</span>)</span><br><span class="line">    <span class="keyword">ON</span> <span class="keyword">DELETE</span> <span class="keyword">CASCADE</span>)</span><br><span class="line">/</span><br><span class="line"><span class="keyword">ALTER</span> <span class="keyword">TABLE</span> q$error_instance <span class="keyword">ADD</span> (</span><br><span class="line">  <span class="keyword">CONSTRAINT</span> q$error_instance_err_fk FOREIGN <span class="keyword">KEY</span> (error_id)</span><br><span class="line">    <span class="keyword">REFERENCES</span> q$<span class="keyword">error</span> (<span class="keyword">id</span>)</span><br><span class="line">    <span class="keyword">ON</span> <span class="keyword">DELETE</span> <span class="keyword">CASCADE</span>)</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.2.17 Provided by Filipe de Silva; add env info. */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">TRIGGER</span> q$error_instance_ir</span><br><span class="line">   <span class="keyword">BEFORE</span> <span class="keyword">INSERT</span></span><br><span class="line">   <span class="keyword">ON</span> q$error_instance</span><br><span class="line">   <span class="keyword">REFERENCING</span> <span class="keyword">OLD</span> <span class="keyword">AS</span> <span class="keyword">old</span> <span class="keyword">NEW</span> <span class="keyword">AS</span> <span class="keyword">new</span></span><br><span class="line">   <span class="keyword">FOR</span> <span class="keyword">EACH</span> <span class="keyword">ROW</span></span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   :new.created_on := <span class="keyword">SYSDATE</span>;</span><br><span class="line">   :new.created_by := SYS_CONTEXT ('USERENV', 'SESSION_USER');</span><br><span class="line"></span><br><span class="line">   :new.environment_info :=</span><br><span class="line">         'instance: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'INSTANCE')</span><br><span class="line">      || '/'</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'INSTANCE_NAME')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'db_name: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'DB_NAME')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'db_domain: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'DB_DOMAIN')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'host: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'SERVER_HOST')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'service_name: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'SERVICE_NAME')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || '<span class="comment">--'</span></span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'session_user: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'SESSION_USER')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'session_id: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'SESSIONID')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || '<span class="comment">--'</span></span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'host: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'HOST')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'ip_address: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'IP_ADDRESS')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'os_user: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'OS_USER')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || '<span class="comment">--'</span></span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'module: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'MODULE')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'action: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'ACTION')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'client_identifier: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'CLIENT_IDENTIFIER')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'client_info: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'CLIENT_INFO')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || '<span class="comment">--'</span></span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'bg_job_id: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'BG_JOB_ID')</span><br><span class="line">      || CHR (10)</span><br><span class="line">      || 'fg_job_id: '</span><br><span class="line">      || SYS_CONTEXT ('USERENV', 'FG_JOB_ID')</span><br><span class="line">      || CHR (10);</span><br><span class="line">      </span><br><span class="line">  <span class="comment">/* 1.3.7 Provided by Filipe Silva */</span></span><br><span class="line">  &lt;&lt;debug_web_variables&gt;&gt;</span><br><span class="line">   <span class="keyword">BEGIN</span></span><br><span class="line">      <span class="keyword">FOR</span> i <span class="keyword">IN</span> <span class="number">1</span> .. OWA.num_cgi_vars</span><br><span class="line">      <span class="keyword">LOOP</span></span><br><span class="line">         :new.environment_info   :=</span><br><span class="line">               :new.environment_info</span><br><span class="line">            || OWA.cgi_var_name (i)</span><br><span class="line">            || <span class="string">': '</span></span><br><span class="line">            || OWA.cgi_var_val (i)</span><br><span class="line">            || <span class="keyword">CHR</span> (<span class="number">10</span>);</span><br><span class="line">      <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">   EXCEPTION</span><br><span class="line">      WHEN VALUE_ERROR</span><br><span class="line">      THEN</span><br><span class="line">         NULL;</span><br><span class="line">   <span class="keyword">END</span> debug_web_variables;</span><br><span class="line">      </span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.7 Trigger needed to allow DBA partition of table.</span></span><br><span class="line"><span class="comment">         Provided by Filipe Silva. */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">TRIGGER</span> <span class="string">"Q$ERROR_CONTEXT_IR"</span> </span><br><span class="line"><span class="keyword">BEFORE</span> <span class="keyword">INSERT</span> <span class="keyword">ON</span> <span class="string">"Q$ERROR_CONTEXT"</span> <span class="keyword">FOR</span> <span class="keyword">EACH</span> <span class="keyword">ROW</span> </span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">    :new.created_on := SYSTIMESTAMP;</span><br><span class="line">    :new.created_by := SYS_CONTEXT ('USERENV', 'SESSION_USER');</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 1.3.7 Populate the changed* columns */</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">TRIGGER</span> <span class="string">"Q$ERROR_CONTEXT_UR"</span> </span><br><span class="line"><span class="keyword">BEFORE</span> <span class="keyword">UPDATE</span> <span class="keyword">ON</span> <span class="string">"Q$ERROR_CONTEXT"</span> <span class="keyword">FOR</span> <span class="keyword">EACH</span> <span class="keyword">ROW</span> </span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">    :new.changed_on := SYSTIMESTAMP;</span><br><span class="line">    :new.changed_by := SYS_CONTEXT ('USERENV', 'SESSION_USER');</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">OR</span> <span class="keyword">REPLACE</span> <span class="keyword">TRIGGER</span> <span class="string">"Q$ERROR_INSTANCE_UR"</span> </span><br><span class="line"><span class="keyword">BEFORE</span> <span class="keyword">UPDATE</span> <span class="keyword">ON</span> <span class="string">"Q$ERROR_INSTANCE"</span> <span class="keyword">FOR</span> <span class="keyword">EACH</span> <span class="keyword">ROW</span> </span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">    :new.changed_on := SYSTIMESTAMP;</span><br><span class="line">    :new.changed_by := SYS_CONTEXT ('USERENV', 'SESSION_USER');</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line">@@q$error_manager.pks</span><br><span class="line"></span><br><span class="line">@@q$error_manager.pkb</span><br><span class="line"></span><br><span class="line">SPOOL OFF</span><br></pre></td></tr></table></figure>
<h2 id="q-error-manager包声明"><a href="#q-error-manager包声明" class="headerlink" title="q$error_manager包声明"></a>q$error_manager包声明</h2><blockquote>
<p><code>q$error_manager.pks</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br><span class="line">650</span><br><span class="line">651</span><br><span class="line">652</span><br><span class="line">653</span><br><span class="line">654</span><br><span class="line">655</span><br><span class="line">656</span><br><span class="line">657</span><br><span class="line">658</span><br><span class="line">659</span><br><span class="line">660</span><br><span class="line">661</span><br><span class="line">662</span><br><span class="line">663</span><br><span class="line">664</span><br><span class="line">665</span><br><span class="line">666</span><br><span class="line">667</span><br><span class="line">668</span><br><span class="line">669</span><br><span class="line">670</span><br><span class="line">671</span><br><span class="line">672</span><br><span class="line">673</span><br><span class="line">674</span><br><span class="line">675</span><br><span class="line">676</span><br><span class="line">677</span><br><span class="line">678</span><br><span class="line">679</span><br><span class="line">680</span><br><span class="line">681</span><br><span class="line">682</span><br><span class="line">683</span><br><span class="line">684</span><br><span class="line">685</span><br><span class="line">686</span><br><span class="line">687</span><br><span class="line">688</span><br><span class="line">689</span><br><span class="line">690</span><br><span class="line">691</span><br><span class="line">692</span><br><span class="line">693</span><br><span class="line">694</span><br><span class="line">695</span><br><span class="line">696</span><br><span class="line">697</span><br><span class="line">698</span><br><span class="line">699</span><br><span class="line">700</span><br><span class="line">701</span><br><span class="line">702</span><br><span class="line">703</span><br><span class="line">704</span><br><span class="line">705</span><br><span class="line">706</span><br><span class="line">707</span><br><span class="line">708</span><br><span class="line">709</span><br><span class="line">710</span><br><span class="line">711</span><br><span class="line">712</span><br><span class="line">713</span><br><span class="line">714</span><br><span class="line">715</span><br><span class="line">716</span><br><span class="line">717</span><br><span class="line">718</span><br><span class="line">719</span><br><span class="line">720</span><br><span class="line">721</span><br><span class="line">722</span><br><span class="line">723</span><br><span class="line">724</span><br><span class="line">725</span><br><span class="line">726</span><br><span class="line">727</span><br><span class="line">728</span><br><span class="line">729</span><br><span class="line">730</span><br><span class="line">731</span><br><span class="line">732</span><br><span class="line">733</span><br><span class="line">734</span><br><span class="line">735</span><br><span class="line">736</span><br><span class="line">737</span><br><span class="line">738</span><br><span class="line">739</span><br><span class="line">740</span><br><span class="line">741</span><br><span class="line">742</span><br><span class="line">743</span><br><span class="line">744</span><br><span class="line">745</span><br><span class="line">746</span><br><span class="line">747</span><br><span class="line">748</span><br><span class="line">749</span><br><span class="line">750</span><br><span class="line">751</span><br><span class="line">752</span><br><span class="line">753</span><br><span class="line">754</span><br><span class="line">755</span><br><span class="line">756</span><br><span class="line">757</span><br><span class="line">758</span><br><span class="line">759</span><br><span class="line">760</span><br><span class="line">761</span><br><span class="line">762</span><br><span class="line">763</span><br><span class="line">764</span><br><span class="line">765</span><br><span class="line">766</span><br><span class="line">767</span><br><span class="line">768</span><br><span class="line">769</span><br><span class="line">770</span><br><span class="line">771</span><br><span class="line">772</span><br><span class="line">773</span><br><span class="line">774</span><br><span class="line">775</span><br><span class="line">776</span><br><span class="line">777</span><br><span class="line">778</span><br><span class="line">779</span><br><span class="line">780</span><br><span class="line">781</span><br><span class="line">782</span><br><span class="line">783</span><br><span class="line">784</span><br><span class="line">785</span><br><span class="line">786</span><br><span class="line">787</span><br><span class="line">788</span><br><span class="line">789</span><br><span class="line">790</span><br><span class="line">791</span><br><span class="line">792</span><br><span class="line">793</span><br><span class="line">794</span><br><span class="line">795</span><br><span class="line">796</span><br><span class="line">797</span><br><span class="line">798</span><br><span class="line">799</span><br><span class="line">800</span><br><span class="line">801</span><br><span class="line">802</span><br><span class="line">803</span><br><span class="line">804</span><br><span class="line">805</span><br><span class="line">806</span><br><span class="line">807</span><br><span class="line">808</span><br><span class="line">809</span><br><span class="line">810</span><br><span class="line">811</span><br><span class="line">812</span><br><span class="line">813</span><br><span class="line">814</span><br><span class="line">815</span><br><span class="line">816</span><br><span class="line">817</span><br><span class="line">818</span><br><span class="line">819</span><br><span class="line">820</span><br><span class="line">821</span><br><span class="line">822</span><br><span class="line">823</span><br><span class="line">824</span><br><span class="line">825</span><br><span class="line">826</span><br><span class="line">827</span><br><span class="line">828</span><br><span class="line">829</span><br><span class="line">830</span><br><span class="line">831</span><br><span class="line">832</span><br><span class="line">833</span><br><span class="line">834</span><br><span class="line">835</span><br><span class="line">836</span><br><span class="line">837</span><br><span class="line">838</span><br><span class="line">839</span><br><span class="line">840</span><br><span class="line">841</span><br><span class="line">842</span><br><span class="line">843</span><br><span class="line">844</span><br><span class="line">845</span><br><span class="line">846</span><br><span class="line">847</span><br><span class="line">848</span><br><span class="line">849</span><br><span class="line">850</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">create</span> <span class="keyword">or</span> <span class="keyword">replace</span> <span class="keyword">PACKAGE</span> q$error_manager</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">| This program is a part of the Quest Error Manager for Oracle.</span></span><br><span class="line"><span class="comment">| This product is freeware and is not supported by Quest.</span></span><br><span class="line"><span class="comment">|</span></span><br><span class="line"><span class="comment">| www.quest.com</span></span><br><span class="line"><span class="comment">|</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">?2009 Quest Software, Inc.</span></span><br><span class="line"><span class="comment">ALL RIGHTS RESERVED.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Redistribution and use of the Quest Error Manager for Oracle software in source and binary forms,</span></span><br><span class="line"><span class="comment">with or without modification, are permitted provided that the following conditions are met:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">1.  Redistributions of source code must retain (i) the following copyright notice: "?008 Quest Software, Inc.</span></span><br><span class="line"><span class="comment">All rights reserved," (ii) this list of conditions, and (iii) the disclaimer below.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">2.  Redistributions in binary form must reproduce (i) the following copyright notice:</span></span><br><span class="line"><span class="comment">"?008 Quest Software, Inc. All rights reserved," (ii) this list of conditions, and (iii)</span></span><br><span class="line"><span class="comment">the disclaimer below, in the documentation and/or other materials provided with the distribution.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">3.  All advertising materials mentioning features or use of the Quest Error Manager</span></span><br><span class="line"><span class="comment">for Oracle software must display the following acknowledgement:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">This product includes software developed by Quest Software, Inc. and its contributors.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">4.  Neither the name of Quest Software, Inc. nor the name its affiliates, subsidiaries</span></span><br><span class="line"><span class="comment">or contributors may be used to endorse or promote products derived from the Quest Error</span></span><br><span class="line"><span class="comment">Manager for Oracle software without specific prior written permission from Quest Software, Inc.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Disclaimer:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">THIS SOFTWARE IS PROVIDED BY QUEST SOFTWARE, INC. AND ITS CONTRIBUTORS ``AS IS''</span></span><br><span class="line"><span class="comment">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,</span></span><br><span class="line"><span class="comment">THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,</span></span><br><span class="line"><span class="comment">AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL QUEST SOFTWARE OR ITS</span></span><br><span class="line"><span class="comment">CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,</span></span><br><span class="line"><span class="comment">OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span></span><br><span class="line"><span class="comment">GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span></span><br><span class="line"><span class="comment">HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span></span><br><span class="line"><span class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE</span></span><br><span class="line"><span class="comment">QUEST ERROR MANAGER SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"><span class="keyword">IS</span></span><br><span class="line">    c_version                  <span class="keyword">CONSTANT</span> PLS_INTEGER := <span class="number">1</span>;</span><br><span class="line">    c_release                  CONSTANT PLS_INTEGER := 4;</span><br><span class="line">    c_subrelease               CONSTANT PLS_INTEGER := 1;</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    Modification History</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Date  Who Vrsn  What</span></span><br><span class="line"><span class="comment">    ----------- ----- ------ -------------------------------------------------------</span></span><br><span class="line"><span class="comment">    Oct 15 2010 FS  1.4.1    * removed declaration of unreference variables</span></span><br><span class="line"><span class="comment">                             * labeled end tags</span></span><br><span class="line"><span class="comment">                             * discard_error_state: clear state already stored</span></span><br><span class="line"><span class="comment">    Jul 27 2010 FS  1.4.0    * add error_category_name field to error_info_rt</span></span><br><span class="line"><span class="comment">                             * minor refactoring</span></span><br><span class="line"><span class="comment">                             * add more last_* functions and last_error_info function to return the record</span></span><br><span class="line"><span class="comment">                             * add option to disregard the remaining_context in the message</span></span><br><span class="line"><span class="comment">    Jul 23 2010 FS  1.3.8    * make register_error truncate text_in to 4000 to make the insert possible</span></span><br><span class="line"><span class="comment">                               (thanks to Bill Pribyl for reporting)</span></span><br><span class="line"><span class="comment">                             * add truncante to 4000 to DBMS_UTILITY.format* output when storing to table</span></span><br><span class="line"><span class="comment">    Mar 22 2010 FS  1.3.7    * add trigger to populate environmental info to q$error_context</span></span><br><span class="line"><span class="comment">                             * q$error_instance_ir trigger: add web environment variables log (if available)</span></span><br><span class="line"><span class="comment">                             * corrected commentaries in example scripts and cleaned unused variables</span></span><br><span class="line"><span class="comment">                             * add missing example file from the last versions: QEM in APEX</span></span><br><span class="line"><span class="comment">    Mar 04 2010 SF  1.3.6    * Change all argument names in raise/register/add from err_</span></span><br><span class="line"><span class="comment">                               to error_ for consistency. Synch up with QCGU scripts.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Feb 19 2010 SF  1.3.5    * Add last* functions so that you can easily get values</span></span><br><span class="line"><span class="comment">                               for last-raised error and among other things test more</span></span><br><span class="line"><span class="comment">                               easily (request from Aci Polajnar).</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Dec 01 2009 SF  1.3.4    * Add clean_up_errors to help users remove error information.</span></span><br><span class="line"><span class="comment">                             * Add grab_settings to register_error (error_name_in, text_in)</span></span><br><span class="line"><span class="comment">                             overload. It was missing.</span></span><br><span class="line"><span class="comment">                             * Remove redundant overloading of register_error (Why did Oracle</span></span><br><span class="line"><span class="comment">                             let me COMPILE it the way it was, I wonder...)</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Oct 05 2009 SF  1.3.3    Change audit dates to TIMESTAMP from DATE</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Sep 12 2009 SF  1.3.2    If error stack is empty assign call stack to it.</span></span><br><span class="line"><span class="comment">                             Add "simple assert" routines that simply call RAE.</span></span><br><span class="line"><span class="comment">                             Add PROCEDURE clean_up_errors to remove rows from</span></span><br><span class="line"><span class="comment">                              q$error_instance and q$error_context.</span></span><br><span class="line"><span class="comment">                              Idea from Dennis Anderson.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Aug 18 2009  SF  1.3.1   Add fields to the error_info_rt and overloadings to also</span></span><br><span class="line"><span class="comment">                              return that information through parameters. Also make sure</span></span><br><span class="line"><span class="comment">                              that environment info is passed back through get_error_info</span></span><br><span class="line"><span class="comment">                              (kudos to Neal Ala for both providing specs and testing the release).</span></span><br><span class="line"><span class="comment">                             Fix bug in exc section of pl (Thanks, Volker Bartuseck)</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Dec 12 2008  SF  1.2.19  Change trigger intro'd in 1.2.17 so that you do NOT need</span></span><br><span class="line"><span class="comment">                             access to v$session to run QEM. It will just ignore the</span></span><br><span class="line"><span class="comment">                             environment info when running the trigger.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Dec 9  2008  SF  1.2.18 Avoid context strings &gt; 500 characters. Thanks, Mike Pinker!</span></span><br><span class="line"><span class="comment">      Add ability to specify multiple distinct contexts.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Nov 10 2008  SF/FS 1.2.17 Minor fixes from feedback by Filipe Silva, add trigger to</span></span><br><span class="line"><span class="comment">      populate environmental info. Also, offer toggle to avoid</span></span><br><span class="line"><span class="comment">      the need to mark an error as unhandled.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Jul 12 2008  SF  1.2.16 Avoid VALUE_ERROR exception for sqlcode_name.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    July 2008 SF  1.2.15 register_oracle_error RAISES an error. Should not do that.</span></span><br><span class="line"><span class="comment">      Thanks to Filipe de Silva for pointing this out.</span></span><br><span class="line"><span class="comment">      Also add overloading to return error instance ID.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Mar 12 2008  SF  1.2.14 Minor refactorings from feedback by Volker Bartusek.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Nov 27 2007  SF  1.2.13 REMOVE DBMS_ERRLOG - only available in 10gR2.</span></span><br><span class="line"><span class="comment">      Will put in separate utility that will come with QEM.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Nov 11 2007  SF  1.2.12 Allow user to show error info in message.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Oct 1  2007  SF  1.2.11 * Start tracking version.</span></span><br><span class="line"><span class="comment">      * Change q$error error code for DUPVAL to -1.</span></span><br><span class="line"><span class="comment">      * Add raise/register_oracle_error alternative.</span></span><br><span class="line"><span class="comment">      * Obtain most recent instance ID from package global</span></span><br><span class="line"><span class="comment">      g_error_instance_raised instead of parsing the</span></span><br><span class="line"><span class="comment">      Oracle error message. This is set in the session</span></span><br><span class="line"><span class="comment">      each time an error is registered.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    Sep 27 2007  SF  SF Add dbms_Errlog functionality</span></span><br><span class="line"><span class="comment">    Sep 26 2007  SF  SF Add raise_unaticipated</span></span><br><span class="line"><span class="comment">    Sep 21 2007  SF  SF Add overloadings with different column names</span></span><br><span class="line"><span class="comment">      err_instance instead of error_instance to support</span></span><br><span class="line"><span class="comment">      backward compatibility with QCGU generated code.</span></span><br><span class="line"><span class="comment">    Sep 5 2007 SF SF Add "not yet implemented" program</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    c_newline                  CONSTANT CHAR (1) := CHR (10);</span><br><span class="line"></span><br><span class="line">    TYPE weak_refcursor IS REF CURSOR;</span><br><span class="line"></span><br><span class="line">    SUBTYPE maxvarchar2_t IS VARCHAR2 (32767);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- public global constants</span></span><br><span class="line">    c_varchar2_max_length      CONSTANT PLS_INTEGER := 32767;</span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    c_varchar2_max_length_db   CONSTANT PLS_INTEGER := 4000;</span><br><span class="line"></span><br><span class="line">    c_subst_char               CONSTANT VARCHAR2 (1) := '$';</span><br><span class="line">    c_error_prefix             CONSTANT VARCHAR2 (4) := 'QEM';</span><br><span class="line">    c_error_prefix_len         CONSTANT PLS_INTEGER := 3;</span><br><span class="line">    c_error_code_len           CONSTANT PLS_INTEGER := 20;</span><br><span class="line">    c_oracle_separator         CONSTANT VARCHAR2 (5) := '-ORA-';</span><br><span class="line">    c_oracle_code_len          CONSTANT PLS_INTEGER := 5;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- public global user-defined types</span></span><br><span class="line">    <span class="comment">-- used to return error info back to a calling context</span></span><br><span class="line">    TYPE error_info_rt IS RECORD</span><br><span class="line">    (</span><br><span class="line">        code                   q$error.code%TYPE</span><br><span class="line">       ,name                   q$error.name%TYPE</span><br><span class="line">       ,system_error_code      q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message   q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,text                   q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,recommendation         q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack            q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack             q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info       q$error_instance.environment_info%TYPE</span><br><span class="line">       <span class="comment">/* Added in 1.3 */</span></span><br><span class="line">       ,id                     q$error_instance.id%TYPE</span><br><span class="line">       ,MESSAGE                q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,error_id               q$error_instance.error_id%TYPE</span><br><span class="line">       ,contexts               maxvarchar2_t</span><br><span class="line">       ,created_on             q$error_instance.created_on%TYPE</span><br><span class="line">       ,created_by             q$error_instance.created_by%TYPE</span><br><span class="line">       ,changed_on             q$error_instance.changed_on%TYPE</span><br><span class="line">       ,changed_by             q$error_instance.changed_by%TYPE</span><br><span class="line">       <span class="comment">/* Added in 1.4.0 */</span></span><br><span class="line">       ,error_category_name    q$error.error_category_name%TYPE</span><br><span class="line">    );</span><br><span class="line"></span><br><span class="line">    TYPE q$log_tc IS TABLE OF q$log%ROWTYPE</span><br><span class="line">                         INDEX BY PLS_INTEGER;</span><br><span class="line"></span><br><span class="line">    TYPE q$error_context_tc IS TABLE OF q$error_context%ROWTYPE</span><br><span class="line">                                   INDEX BY PLS_INTEGER;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Error/warning management</span></span><br><span class="line">    c_error                    CONSTANT CHAR (5) := 'ERROR';</span><br><span class="line">    c_info_msg                 CONSTANT CHAR (4) := 'INFO';</span><br><span class="line">    c_warning                  CONSTANT CHAR (7) := 'WARNING';</span><br><span class="line">    c_status_delimiter         CONSTANT CHAR (1) := ':';</span><br><span class="line">    <span class="comment">/* Special NYI exception */</span></span><br><span class="line">    e_not_yet_implemented               EXCEPTION;</span><br><span class="line">    c_not_yet_implemented               PLS_INTEGER := -20999;</span><br><span class="line">    <span class="keyword">PRAGMA</span> EXCEPTION_INIT (e_not_yet_implemented, <span class="number">-20999</span>);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- public global routines</span></span><br><span class="line">    <span class="comment">-- -------------------------------------</span></span><br><span class="line">    <span class="comment">-- Tracing and DBMS_OUTPUT encapsulation</span></span><br><span class="line">    <span class="comment">-- -------------------------------------</span></span><br><span class="line">    <span class="comment">-- switches output to the console</span></span><br><span class="line">    <span class="comment">-- <span class="doctag">NOTE:</span> default is to Table</span></span><br><span class="line">    PROCEDURE toscreen;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- switches output to the q$log. table</span></span><br><span class="line">    <span class="comment">-- <span class="doctag">NOTE:</span> this is the default destination</span></span><br><span class="line">    PROCEDURE totable;</span><br><span class="line"></span><br><span class="line">    PROCEDURE totable (purge_in IN BOOLEAN);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Send output to file. tofile opens the file; trace off closes the file.</span></span><br><span class="line">    PROCEDURE tofile (dir_in         IN VARCHAR2</span><br><span class="line">                     ,file_in        IN VARCHAR2</span><br><span class="line">                     ,overwrite_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- simple DBMS_OUTPUT handling of 255 char limit</span></span><br><span class="line">    <span class="comment">-- looks for a newline, or chops to fit given length</span></span><br><span class="line">    PROCEDURE pl (string_in IN VARCHAR2, length_in IN PLS_INTEGER := 80);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- converts the given boolean value to string,</span></span><br><span class="line">    <span class="comment">-- then writes it out as above</span></span><br><span class="line">    PROCEDURE pl (val IN BOOLEAN);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- as above but concatenates str with the string value of bool</span></span><br><span class="line">    <span class="comment">-- e.g., 'cursor%found TRUE'</span></span><br><span class="line">    PROCEDURE pl (str IN VARCHAR2, bool IN BOOLEAN, len IN PLS_INTEGER := 80);</span><br><span class="line"></span><br><span class="line">    PROCEDURE pl (clob_in IN CLOB, length_in IN PLS_INTEGER := 80);</span><br><span class="line"></span><br><span class="line">    PROCEDURE set_error_trace (onoff_in IN BOOLEAN);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- When error trace is turned on, all errors are also written</span></span><br><span class="line">    <span class="comment">-- to the log table automatically.</span></span><br><span class="line">    PROCEDURE error_trace_on;</span><br><span class="line"></span><br><span class="line">    PROCEDURE error_trace_off;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_trace_enabled</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 control the adding or not of the remaining_context to the text message</span></span><br><span class="line"><span class="comment">       by default it's on*/</span></span><br><span class="line">    PROCEDURE add_remaining_context_msg_on;</span><br><span class="line"></span><br><span class="line">    PROCEDURE add_remaining_context_msg_off;</span><br><span class="line"></span><br><span class="line">    PROCEDURE set_add_remaining_context_msg (onoff_in IN BOOLEAN);</span><br><span class="line"></span><br><span class="line">    FUNCTION add_remaining_context_enabled</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Controls the trace mechanism via a private global variable</span></span><br><span class="line">    <span class="comment">-- and sets the trace context filter (defaults to all traces)</span></span><br><span class="line">    <span class="comment">-- <span class="doctag">NOTE:</span> tracing defaults to FALSE on package initialization</span></span><br><span class="line">    <span class="comment">--   only one context can be in force at a time</span></span><br><span class="line">    <span class="comment">--   and is case-insensitive</span></span><br><span class="line">    PROCEDURE set_trace (onoff_in               IN BOOLEAN</span><br><span class="line">                        ,context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                        ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                        ,delimiter_in           IN VARCHAR2 DEFAULT ',');</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Clears out the trace contents. Currently just deletes from q$log.</span></span><br><span class="line">    PROCEDURE clear_trace;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace_on (context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                       ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                       ,delimiter_in           IN VARCHAR2 DEFAULT ',');</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace_off (context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                        ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Has tracing been turned on globally?</span></span><br><span class="line">    FUNCTION trace_enabled</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Has tracing been turned on globally or for a specific context?</span></span><br><span class="line">    <span class="comment">-- Context values are compared using UPPER case.</span></span><br><span class="line">    FUNCTION trace_enabled (context_in IN q$log.context%TYPE)</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Writes output to the screen or q$log. table</span></span><br><span class="line">    <span class="comment">-- (see toscreen and totable above)</span></span><br><span class="line">    <span class="comment">-- If you pass TRUE for force parameter, this program will write to the log</span></span><br><span class="line">    <span class="comment">-- even if overall tracing is disabled.</span></span><br><span class="line">    <span class="comment">-- Level results in indentation to help you understand the log output.</span></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,text_in          IN q$log.text%TYPE</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,number_in        IN NUMBER</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,date_in          IN DATE</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,boolean_in       IN BOOLEAN</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,clob_in          IN CLOB</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- writes to the console the trace rows</span></span><br><span class="line">    <span class="comment">-- given (optionally filtered in any combination):</span></span><br><span class="line">    <span class="comment">--  trace id, context, text</span></span><br><span class="line">    <span class="comment">-- may be limited by limit_in</span></span><br><span class="line">    <span class="comment">-- call stack can also be displayed</span></span><br><span class="line">    PROCEDURE show_trace (from_id_in              IN q$log.id%TYPE := NULL</span><br><span class="line">                         ,context_like_in         IN VARCHAR2 := '%'</span><br><span class="line">                         ,text_like_in            IN VARCHAR2 := '%'</span><br><span class="line">                         ,limit_in                IN PLS_INTEGER := NULL</span><br><span class="line">                         ,include_call_stack_in   IN BOOLEAN := TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-------------------------------------------</span></span><br><span class="line">    <span class="comment">-- Error handling and raising functionality</span></span><br><span class="line">    <span class="comment">-------------------------------------------</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- An error needs to be raised or logged.</span></span><br><span class="line">    <span class="comment">-- Get a message handle for this particular error instance.</span></span><br><span class="line">    <span class="comment">-- The "error message" id keeps track of both the error</span></span><br><span class="line">    <span class="comment">-- and message information. This program also serves as</span></span><br><span class="line">    <span class="comment">-- "record and go" and "go". In other words, we do not</span></span><br><span class="line">    <span class="comment">-- raise an error, but it is noted.</span></span><br><span class="line">    <span class="comment">--</span></span><br><span class="line">    PROCEDURE register_error (</span><br><span class="line">        error_code_in           IN     q$error.code%TYPE</span><br><span class="line">       ,error_instance_id_out   IN OUT q$error_instance.id%TYPE</span><br><span class="line">       ,text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Pass in error name instead of code.</span></span><br><span class="line">    PROCEDURE register_error (</span><br><span class="line">        error_name_in           IN     q$error.name%TYPE</span><br><span class="line">       ,error_instance_id_out   IN OUT q$error_instance.id%TYPE</span><br><span class="line">       ,text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name - this OL no longer needed</span></span><br><span class="line"><span class="comment">    PROCEDURE register_error (</span></span><br><span class="line"><span class="comment">       error_code_in       IN     q$error.code%TYPE</span></span><br><span class="line"><span class="comment">     , error_instance_id_out IN OUT q$error_instance.id%TYPE</span></span><br><span class="line"><span class="comment">     , text_in             IN     q$error_instance.MESSAGE%TYPE:= NULL</span></span><br><span class="line"><span class="comment">     , name1_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , value1_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , name2_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , value2_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , name3_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , value3_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , name4_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , value4_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , name5_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , value5_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="comment">     , grab_settings_in    IN     BOOLEAN DEFAULT TRUE</span></span><br><span class="line"><span class="comment">    );</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Record error (using name or code), but ignore error instance.</span></span><br><span class="line">    <span class="comment">-- Essentially, this is "record but do not raise error."</span></span><br><span class="line">    PROCEDURE register_error (</span><br><span class="line">        error_code_in      IN q$error.code%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE DEFAULT NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE register_error (</span><br><span class="line">        error_name_in      IN q$error.name%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Set a single context value for an error_instance row.</span></span><br><span class="line">    <span class="comment">-- Should overload this for a variety of datatypes.</span></span><br><span class="line">    PROCEDURE add_context (</span><br><span class="line">        error_instance_id_in   IN q$error_instance.id%TYPE</span><br><span class="line">       ,NAME_IN                IN q$error_context.name%TYPE</span><br><span class="line">       ,value_in               IN q$error_context.VALUE%TYPE</span><br><span class="line">       ,validate_in            IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Do not maintain an overloading only with an arg name change.</span></span><br><span class="line"><span class="comment">    PROCEDURE add_context (err_instance_id_in IN q$error_instance.id%TYPE</span></span><br><span class="line"><span class="comment">                         , NAME_IN            IN q$error_context.name%TYPE</span></span><br><span class="line"><span class="comment">                         , value_in           IN q$error_context.VALUE%TYPE</span></span><br><span class="line"><span class="comment">                         , validate_in        IN BOOLEAN DEFAULT TRUE</span></span><br><span class="line"><span class="comment">                          );*/</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Global contexts; not tied to any specific instance.</span></span><br><span class="line">    PROCEDURE add_gcontext (NAME_IN    IN q$error_context.name%TYPE</span><br><span class="line">                           ,value_in   IN q$error_context.VALUE%TYPE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Remove all global contexts.</span></span><br><span class="line">    <span class="comment">-- This is called by mark_q$error_handled as well.</span></span><br><span class="line">    PROCEDURE clear_gcontexts;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    Raise specified error, providing minimal message</span></span><br><span class="line"><span class="comment">    information in a single procedure call.</span></span><br><span class="line"><span class="comment">    No context information is passed; if message text</span></span><br><span class="line"><span class="comment">    is not provided then the default with the error</span></span><br><span class="line"><span class="comment">    is used.</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    PROCEDURE raise_error (</span><br><span class="line">        error_code_in      IN q$error.code%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_error (</span><br><span class="line">        error_name_in      IN q$error.name%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE raise_error_instance (</span><br><span class="line">        error_instance_id_in IN q$error_instance.id%TYPE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* Raise an unanticipated error. */</span></span><br><span class="line">    PROCEDURE raise_unanticipated (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* V1.2.11 Allow user to specify that an Oracle error should be registered</span></span><br><span class="line"><span class="comment">     (but not re-raised) or raised (registered and re-raised).</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    PROCEDURE register_oracle_error (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.2.15 Return error instance */</span></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE register_oracle_error (</span><br><span class="line">        text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE</span><br><span class="line">       ,error_instance_id_out      OUT q$error_instance.id%TYPE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_oracle_error (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* Get error info for latest error. */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in   IN     q$error_instance.id%TYPE</span><br><span class="line">       ,error_info_out            OUT error_info_rt</span><br><span class="line">       ,context_delimiter_in   IN     VARCHAR2 DEFAULT c_newline);</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (error_info_out OUT error_info_rt);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_info</span><br><span class="line">        RETURN error_info_rt;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION q$error_raised</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">--Simplest format, no composite structures</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        code_out                   OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                   OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out      OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out   OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out         OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out            OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out             OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out       OUT q$error_instance.environment_info%TYPE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in       IN     q$error_instance.id%TYPE</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_message_in           IN     VARCHAR2</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3 Add id and message as OUT arguments */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline);</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in       IN     q$error_instance.id%TYPE</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_message_in           IN     VARCHAR2</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_id</span><br><span class="line">        RETURN q$error.id%TYPE;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_instance_id</span><br><span class="line">        RETURN q$error_instance.id%TYPE;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_category_name</span><br><span class="line">        RETURN q$error.error_category_name%TYPE;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_code</span><br><span class="line">        RETURN q$error.code%TYPE;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_name</span><br><span class="line">        RETURN q$error.name%TYPE;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_text</span><br><span class="line">        RETURN q$error_instance.MESSAGE%TYPE;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_system_error_code</span><br><span class="line">        RETURN q$error_instance.system_error_code%TYPE;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_system_error_message</span><br><span class="line">        RETURN q$error_instance.system_error_message%TYPE;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    PROCEDURE show_error_info (</span><br><span class="line">        error_instance_id_in   IN q$error_instance.id%TYPE</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_after (</span><br><span class="line">        date_in                IN DATE</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_with_message (</span><br><span class="line">        text_in                IN VARCHAR2</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_with_code (</span><br><span class="line">        error_code_in             IN PLS_INTEGER</span><br><span class="line">       ,is_system_error_code_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">       ,copy_to_clipboard_in      IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_for (</span><br><span class="line">        where_clause_in        IN VARCHAR2</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE);</span><br><span class="line"></span><br><span class="line">    FUNCTION error_clipboard (clear_clipboard_in IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_clipboard_is_full</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    PROCEDURE clear_error_clipboard;</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in    IN BOOLEAN</span><br><span class="line">                     ,text_in         IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,error_code_in   IN q$error.code%TYPE</span><br><span class="line">                     ,name1_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in       IN VARCHAR2 DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in    IN BOOLEAN</span><br><span class="line">                     ,text_in         IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,error_name_in   IN q$error.name%TYPE</span><br><span class="line">                     ,name1_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in       IN VARCHAR2 DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in   IN BOOLEAN</span><br><span class="line">                     ,text_in        IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,name1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in      IN VARCHAR2 DEFAULT NULL);</span><br><span class="line"></span><br><span class="line">    PROCEDURE simple_assert (</span><br><span class="line">        condition_in         IN BOOLEAN</span><br><span class="line">       ,text_in              IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,name1_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,raise_with_code_in   IN PLS_INTEGER DEFAULT -20000);</span><br><span class="line"></span><br><span class="line">    PROCEDURE mark_q$error_handled;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Added/exposed in 1.1.1</span></span><br><span class="line">    FUNCTION error_instance_from_string (string_in IN VARCHAR2)</span><br><span class="line">        RETURN PLS_INTEGER;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_instance_from_sqlerrm</span><br><span class="line">        RETURN PLS_INTEGER;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- 1.2 Get message text only</span></span><br><span class="line">    FUNCTION error_message</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    PROCEDURE start_execution (program_name_in   IN VARCHAR2 := NULL</span><br><span class="line">                              ,information_in    IN VARCHAR2 := NULL);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    Test builder validation:</span></span><br><span class="line"><span class="comment">      * return a status string composed of type:message</span></span><br><span class="line"><span class="comment">      * if no prefix, then it is an error</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    FUNCTION is_warning (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    FUNCTION is_error (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    FUNCTION is_info_msg (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    PROCEDURE parse_status_string (status_in         IN     VARCHAR2</span><br><span class="line">                                  ,status_type_out      OUT VARCHAR2</span><br><span class="line">                                  ,message_out          OUT VARCHAR2);</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_a_warning (status_inout IN OUT VARCHAR2);</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_an_error (status_inout IN OUT VARCHAR2);</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_an_info_msg (status_inout IN OUT VARCHAR2);</span><br><span class="line"></span><br><span class="line">    FUNCTION make_a_warning (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_an_error (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_an_info_msg (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    FUNCTION full_log_string (context_in   IN VARCHAR2</span><br><span class="line">                             ,text_in      IN VARCHAR2</span><br><span class="line">                             ,level_in     IN PLS_INTEGER)</span><br><span class="line">        RETURN VARCHAR2;</span><br><span class="line"></span><br><span class="line">    FUNCTION log_entries_after (timestamp_in IN DATE)</span><br><span class="line">        RETURN SYS_REFCURSOR;</span><br><span class="line"></span><br><span class="line">    PROCEDURE not_yet_implemented (program_name_in IN VARCHAR2);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.2.12</span></span><br><span class="line"><span class="comment">      Provide switch to force display of "real" error in the error message,</span></span><br><span class="line"><span class="comment">      rather than simply showing the error handle. You should ask for</span></span><br><span class="line"><span class="comment">      "raise with message" when you are not going to use the get_error_info</span></span><br><span class="line"><span class="comment">      program to extract error information.</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    PROCEDURE raise_with_message;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* Only show the error instance handle in the error message. This is the</span></span><br><span class="line"><span class="comment">     default and assumes that you will be calling get_error_info to</span></span><br><span class="line"><span class="comment">     extract all the info. */</span></span><br><span class="line">    PROCEDURE raise_with_handle;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.2.17 Specify that you do NOT want the error state cached. This means</span></span><br><span class="line"><span class="comment">      that you will not have to explicitly mark the error as handled,</span></span><br><span class="line"><span class="comment">      but this also means that if successive layers in your call stack</span></span><br><span class="line"><span class="comment">      handle and re-raise your exception with QEM, you will see</span></span><br><span class="line"><span class="comment">      multiple entries in your error instance table. */</span></span><br><span class="line">    PROCEDURE discard_error_state;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* The default */</span></span><br><span class="line">    PROCEDURE keep_error_state;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_state_discarded</span><br><span class="line">        RETURN BOOLEAN;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* Remove data from q$error_instance and q$error_context</span></span><br><span class="line"><span class="comment">       for all errors that were reported earlier than the</span></span><br><span class="line"><span class="comment">       specified date. Pass NULL (default) to remove all rows.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">       <span class="doctag">NOTE:</span> This is a pragma autonomous_transaction; procedure.</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    PROCEDURE clean_up_errors (older_than_in IN DATE DEFAULT NULL);</span><br><span class="line"><span class="keyword">END</span> q$error_manager;</span><br><span class="line">/</span><br></pre></td></tr></table></figure>
<h2 id="q-error-manager包体"><a href="#q-error-manager包体" class="headerlink" title="q$error_manager包体"></a>q$error_manager包体</h2><blockquote>
<p><code>q$error_manager.pkb</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br><span class="line">650</span><br><span class="line">651</span><br><span class="line">652</span><br><span class="line">653</span><br><span class="line">654</span><br><span class="line">655</span><br><span class="line">656</span><br><span class="line">657</span><br><span class="line">658</span><br><span class="line">659</span><br><span class="line">660</span><br><span class="line">661</span><br><span class="line">662</span><br><span class="line">663</span><br><span class="line">664</span><br><span class="line">665</span><br><span class="line">666</span><br><span class="line">667</span><br><span class="line">668</span><br><span class="line">669</span><br><span class="line">670</span><br><span class="line">671</span><br><span class="line">672</span><br><span class="line">673</span><br><span class="line">674</span><br><span class="line">675</span><br><span class="line">676</span><br><span class="line">677</span><br><span class="line">678</span><br><span class="line">679</span><br><span class="line">680</span><br><span class="line">681</span><br><span class="line">682</span><br><span class="line">683</span><br><span class="line">684</span><br><span class="line">685</span><br><span class="line">686</span><br><span class="line">687</span><br><span class="line">688</span><br><span class="line">689</span><br><span class="line">690</span><br><span class="line">691</span><br><span class="line">692</span><br><span class="line">693</span><br><span class="line">694</span><br><span class="line">695</span><br><span class="line">696</span><br><span class="line">697</span><br><span class="line">698</span><br><span class="line">699</span><br><span class="line">700</span><br><span class="line">701</span><br><span class="line">702</span><br><span class="line">703</span><br><span class="line">704</span><br><span class="line">705</span><br><span class="line">706</span><br><span class="line">707</span><br><span class="line">708</span><br><span class="line">709</span><br><span class="line">710</span><br><span class="line">711</span><br><span class="line">712</span><br><span class="line">713</span><br><span class="line">714</span><br><span class="line">715</span><br><span class="line">716</span><br><span class="line">717</span><br><span class="line">718</span><br><span class="line">719</span><br><span class="line">720</span><br><span class="line">721</span><br><span class="line">722</span><br><span class="line">723</span><br><span class="line">724</span><br><span class="line">725</span><br><span class="line">726</span><br><span class="line">727</span><br><span class="line">728</span><br><span class="line">729</span><br><span class="line">730</span><br><span class="line">731</span><br><span class="line">732</span><br><span class="line">733</span><br><span class="line">734</span><br><span class="line">735</span><br><span class="line">736</span><br><span class="line">737</span><br><span class="line">738</span><br><span class="line">739</span><br><span class="line">740</span><br><span class="line">741</span><br><span class="line">742</span><br><span class="line">743</span><br><span class="line">744</span><br><span class="line">745</span><br><span class="line">746</span><br><span class="line">747</span><br><span class="line">748</span><br><span class="line">749</span><br><span class="line">750</span><br><span class="line">751</span><br><span class="line">752</span><br><span class="line">753</span><br><span class="line">754</span><br><span class="line">755</span><br><span class="line">756</span><br><span class="line">757</span><br><span class="line">758</span><br><span class="line">759</span><br><span class="line">760</span><br><span class="line">761</span><br><span class="line">762</span><br><span class="line">763</span><br><span class="line">764</span><br><span class="line">765</span><br><span class="line">766</span><br><span class="line">767</span><br><span class="line">768</span><br><span class="line">769</span><br><span class="line">770</span><br><span class="line">771</span><br><span class="line">772</span><br><span class="line">773</span><br><span class="line">774</span><br><span class="line">775</span><br><span class="line">776</span><br><span class="line">777</span><br><span class="line">778</span><br><span class="line">779</span><br><span class="line">780</span><br><span class="line">781</span><br><span class="line">782</span><br><span class="line">783</span><br><span class="line">784</span><br><span class="line">785</span><br><span class="line">786</span><br><span class="line">787</span><br><span class="line">788</span><br><span class="line">789</span><br><span class="line">790</span><br><span class="line">791</span><br><span class="line">792</span><br><span class="line">793</span><br><span class="line">794</span><br><span class="line">795</span><br><span class="line">796</span><br><span class="line">797</span><br><span class="line">798</span><br><span class="line">799</span><br><span class="line">800</span><br><span class="line">801</span><br><span class="line">802</span><br><span class="line">803</span><br><span class="line">804</span><br><span class="line">805</span><br><span class="line">806</span><br><span class="line">807</span><br><span class="line">808</span><br><span class="line">809</span><br><span class="line">810</span><br><span class="line">811</span><br><span class="line">812</span><br><span class="line">813</span><br><span class="line">814</span><br><span class="line">815</span><br><span class="line">816</span><br><span class="line">817</span><br><span class="line">818</span><br><span class="line">819</span><br><span class="line">820</span><br><span class="line">821</span><br><span class="line">822</span><br><span class="line">823</span><br><span class="line">824</span><br><span class="line">825</span><br><span class="line">826</span><br><span class="line">827</span><br><span class="line">828</span><br><span class="line">829</span><br><span class="line">830</span><br><span class="line">831</span><br><span class="line">832</span><br><span class="line">833</span><br><span class="line">834</span><br><span class="line">835</span><br><span class="line">836</span><br><span class="line">837</span><br><span class="line">838</span><br><span class="line">839</span><br><span class="line">840</span><br><span class="line">841</span><br><span class="line">842</span><br><span class="line">843</span><br><span class="line">844</span><br><span class="line">845</span><br><span class="line">846</span><br><span class="line">847</span><br><span class="line">848</span><br><span class="line">849</span><br><span class="line">850</span><br><span class="line">851</span><br><span class="line">852</span><br><span class="line">853</span><br><span class="line">854</span><br><span class="line">855</span><br><span class="line">856</span><br><span class="line">857</span><br><span class="line">858</span><br><span class="line">859</span><br><span class="line">860</span><br><span class="line">861</span><br><span class="line">862</span><br><span class="line">863</span><br><span class="line">864</span><br><span class="line">865</span><br><span class="line">866</span><br><span class="line">867</span><br><span class="line">868</span><br><span class="line">869</span><br><span class="line">870</span><br><span class="line">871</span><br><span class="line">872</span><br><span class="line">873</span><br><span class="line">874</span><br><span class="line">875</span><br><span class="line">876</span><br><span class="line">877</span><br><span class="line">878</span><br><span class="line">879</span><br><span class="line">880</span><br><span class="line">881</span><br><span class="line">882</span><br><span class="line">883</span><br><span class="line">884</span><br><span class="line">885</span><br><span class="line">886</span><br><span class="line">887</span><br><span class="line">888</span><br><span class="line">889</span><br><span class="line">890</span><br><span class="line">891</span><br><span class="line">892</span><br><span class="line">893</span><br><span class="line">894</span><br><span class="line">895</span><br><span class="line">896</span><br><span class="line">897</span><br><span class="line">898</span><br><span class="line">899</span><br><span class="line">900</span><br><span class="line">901</span><br><span class="line">902</span><br><span class="line">903</span><br><span class="line">904</span><br><span class="line">905</span><br><span class="line">906</span><br><span class="line">907</span><br><span class="line">908</span><br><span class="line">909</span><br><span class="line">910</span><br><span class="line">911</span><br><span class="line">912</span><br><span class="line">913</span><br><span class="line">914</span><br><span class="line">915</span><br><span class="line">916</span><br><span class="line">917</span><br><span class="line">918</span><br><span class="line">919</span><br><span class="line">920</span><br><span class="line">921</span><br><span class="line">922</span><br><span class="line">923</span><br><span class="line">924</span><br><span class="line">925</span><br><span class="line">926</span><br><span class="line">927</span><br><span class="line">928</span><br><span class="line">929</span><br><span class="line">930</span><br><span class="line">931</span><br><span class="line">932</span><br><span class="line">933</span><br><span class="line">934</span><br><span class="line">935</span><br><span class="line">936</span><br><span class="line">937</span><br><span class="line">938</span><br><span class="line">939</span><br><span class="line">940</span><br><span class="line">941</span><br><span class="line">942</span><br><span class="line">943</span><br><span class="line">944</span><br><span class="line">945</span><br><span class="line">946</span><br><span class="line">947</span><br><span class="line">948</span><br><span class="line">949</span><br><span class="line">950</span><br><span class="line">951</span><br><span class="line">952</span><br><span class="line">953</span><br><span class="line">954</span><br><span class="line">955</span><br><span class="line">956</span><br><span class="line">957</span><br><span class="line">958</span><br><span class="line">959</span><br><span class="line">960</span><br><span class="line">961</span><br><span class="line">962</span><br><span class="line">963</span><br><span class="line">964</span><br><span class="line">965</span><br><span class="line">966</span><br><span class="line">967</span><br><span class="line">968</span><br><span class="line">969</span><br><span class="line">970</span><br><span class="line">971</span><br><span class="line">972</span><br><span class="line">973</span><br><span class="line">974</span><br><span class="line">975</span><br><span class="line">976</span><br><span class="line">977</span><br><span class="line">978</span><br><span class="line">979</span><br><span class="line">980</span><br><span class="line">981</span><br><span class="line">982</span><br><span class="line">983</span><br><span class="line">984</span><br><span class="line">985</span><br><span class="line">986</span><br><span class="line">987</span><br><span class="line">988</span><br><span class="line">989</span><br><span class="line">990</span><br><span class="line">991</span><br><span class="line">992</span><br><span class="line">993</span><br><span class="line">994</span><br><span class="line">995</span><br><span class="line">996</span><br><span class="line">997</span><br><span class="line">998</span><br><span class="line">999</span><br><span class="line">1000</span><br><span class="line">1001</span><br><span class="line">1002</span><br><span class="line">1003</span><br><span class="line">1004</span><br><span class="line">1005</span><br><span class="line">1006</span><br><span class="line">1007</span><br><span class="line">1008</span><br><span class="line">1009</span><br><span class="line">1010</span><br><span class="line">1011</span><br><span class="line">1012</span><br><span class="line">1013</span><br><span class="line">1014</span><br><span class="line">1015</span><br><span class="line">1016</span><br><span class="line">1017</span><br><span class="line">1018</span><br><span class="line">1019</span><br><span class="line">1020</span><br><span class="line">1021</span><br><span class="line">1022</span><br><span class="line">1023</span><br><span class="line">1024</span><br><span class="line">1025</span><br><span class="line">1026</span><br><span class="line">1027</span><br><span class="line">1028</span><br><span class="line">1029</span><br><span class="line">1030</span><br><span class="line">1031</span><br><span class="line">1032</span><br><span class="line">1033</span><br><span class="line">1034</span><br><span class="line">1035</span><br><span class="line">1036</span><br><span class="line">1037</span><br><span class="line">1038</span><br><span class="line">1039</span><br><span class="line">1040</span><br><span class="line">1041</span><br><span class="line">1042</span><br><span class="line">1043</span><br><span class="line">1044</span><br><span class="line">1045</span><br><span class="line">1046</span><br><span class="line">1047</span><br><span class="line">1048</span><br><span class="line">1049</span><br><span class="line">1050</span><br><span class="line">1051</span><br><span class="line">1052</span><br><span class="line">1053</span><br><span class="line">1054</span><br><span class="line">1055</span><br><span class="line">1056</span><br><span class="line">1057</span><br><span class="line">1058</span><br><span class="line">1059</span><br><span class="line">1060</span><br><span class="line">1061</span><br><span class="line">1062</span><br><span class="line">1063</span><br><span class="line">1064</span><br><span class="line">1065</span><br><span class="line">1066</span><br><span class="line">1067</span><br><span class="line">1068</span><br><span class="line">1069</span><br><span class="line">1070</span><br><span class="line">1071</span><br><span class="line">1072</span><br><span class="line">1073</span><br><span class="line">1074</span><br><span class="line">1075</span><br><span class="line">1076</span><br><span class="line">1077</span><br><span class="line">1078</span><br><span class="line">1079</span><br><span class="line">1080</span><br><span class="line">1081</span><br><span class="line">1082</span><br><span class="line">1083</span><br><span class="line">1084</span><br><span class="line">1085</span><br><span class="line">1086</span><br><span class="line">1087</span><br><span class="line">1088</span><br><span class="line">1089</span><br><span class="line">1090</span><br><span class="line">1091</span><br><span class="line">1092</span><br><span class="line">1093</span><br><span class="line">1094</span><br><span class="line">1095</span><br><span class="line">1096</span><br><span class="line">1097</span><br><span class="line">1098</span><br><span class="line">1099</span><br><span class="line">1100</span><br><span class="line">1101</span><br><span class="line">1102</span><br><span class="line">1103</span><br><span class="line">1104</span><br><span class="line">1105</span><br><span class="line">1106</span><br><span class="line">1107</span><br><span class="line">1108</span><br><span class="line">1109</span><br><span class="line">1110</span><br><span class="line">1111</span><br><span class="line">1112</span><br><span class="line">1113</span><br><span class="line">1114</span><br><span class="line">1115</span><br><span class="line">1116</span><br><span class="line">1117</span><br><span class="line">1118</span><br><span class="line">1119</span><br><span class="line">1120</span><br><span class="line">1121</span><br><span class="line">1122</span><br><span class="line">1123</span><br><span class="line">1124</span><br><span class="line">1125</span><br><span class="line">1126</span><br><span class="line">1127</span><br><span class="line">1128</span><br><span class="line">1129</span><br><span class="line">1130</span><br><span class="line">1131</span><br><span class="line">1132</span><br><span class="line">1133</span><br><span class="line">1134</span><br><span class="line">1135</span><br><span class="line">1136</span><br><span class="line">1137</span><br><span class="line">1138</span><br><span class="line">1139</span><br><span class="line">1140</span><br><span class="line">1141</span><br><span class="line">1142</span><br><span class="line">1143</span><br><span class="line">1144</span><br><span class="line">1145</span><br><span class="line">1146</span><br><span class="line">1147</span><br><span class="line">1148</span><br><span class="line">1149</span><br><span class="line">1150</span><br><span class="line">1151</span><br><span class="line">1152</span><br><span class="line">1153</span><br><span class="line">1154</span><br><span class="line">1155</span><br><span class="line">1156</span><br><span class="line">1157</span><br><span class="line">1158</span><br><span class="line">1159</span><br><span class="line">1160</span><br><span class="line">1161</span><br><span class="line">1162</span><br><span class="line">1163</span><br><span class="line">1164</span><br><span class="line">1165</span><br><span class="line">1166</span><br><span class="line">1167</span><br><span class="line">1168</span><br><span class="line">1169</span><br><span class="line">1170</span><br><span class="line">1171</span><br><span class="line">1172</span><br><span class="line">1173</span><br><span class="line">1174</span><br><span class="line">1175</span><br><span class="line">1176</span><br><span class="line">1177</span><br><span class="line">1178</span><br><span class="line">1179</span><br><span class="line">1180</span><br><span class="line">1181</span><br><span class="line">1182</span><br><span class="line">1183</span><br><span class="line">1184</span><br><span class="line">1185</span><br><span class="line">1186</span><br><span class="line">1187</span><br><span class="line">1188</span><br><span class="line">1189</span><br><span class="line">1190</span><br><span class="line">1191</span><br><span class="line">1192</span><br><span class="line">1193</span><br><span class="line">1194</span><br><span class="line">1195</span><br><span class="line">1196</span><br><span class="line">1197</span><br><span class="line">1198</span><br><span class="line">1199</span><br><span class="line">1200</span><br><span class="line">1201</span><br><span class="line">1202</span><br><span class="line">1203</span><br><span class="line">1204</span><br><span class="line">1205</span><br><span class="line">1206</span><br><span class="line">1207</span><br><span class="line">1208</span><br><span class="line">1209</span><br><span class="line">1210</span><br><span class="line">1211</span><br><span class="line">1212</span><br><span class="line">1213</span><br><span class="line">1214</span><br><span class="line">1215</span><br><span class="line">1216</span><br><span class="line">1217</span><br><span class="line">1218</span><br><span class="line">1219</span><br><span class="line">1220</span><br><span class="line">1221</span><br><span class="line">1222</span><br><span class="line">1223</span><br><span class="line">1224</span><br><span class="line">1225</span><br><span class="line">1226</span><br><span class="line">1227</span><br><span class="line">1228</span><br><span class="line">1229</span><br><span class="line">1230</span><br><span class="line">1231</span><br><span class="line">1232</span><br><span class="line">1233</span><br><span class="line">1234</span><br><span class="line">1235</span><br><span class="line">1236</span><br><span class="line">1237</span><br><span class="line">1238</span><br><span class="line">1239</span><br><span class="line">1240</span><br><span class="line">1241</span><br><span class="line">1242</span><br><span class="line">1243</span><br><span class="line">1244</span><br><span class="line">1245</span><br><span class="line">1246</span><br><span class="line">1247</span><br><span class="line">1248</span><br><span class="line">1249</span><br><span class="line">1250</span><br><span class="line">1251</span><br><span class="line">1252</span><br><span class="line">1253</span><br><span class="line">1254</span><br><span class="line">1255</span><br><span class="line">1256</span><br><span class="line">1257</span><br><span class="line">1258</span><br><span class="line">1259</span><br><span class="line">1260</span><br><span class="line">1261</span><br><span class="line">1262</span><br><span class="line">1263</span><br><span class="line">1264</span><br><span class="line">1265</span><br><span class="line">1266</span><br><span class="line">1267</span><br><span class="line">1268</span><br><span class="line">1269</span><br><span class="line">1270</span><br><span class="line">1271</span><br><span class="line">1272</span><br><span class="line">1273</span><br><span class="line">1274</span><br><span class="line">1275</span><br><span class="line">1276</span><br><span class="line">1277</span><br><span class="line">1278</span><br><span class="line">1279</span><br><span class="line">1280</span><br><span class="line">1281</span><br><span class="line">1282</span><br><span class="line">1283</span><br><span class="line">1284</span><br><span class="line">1285</span><br><span class="line">1286</span><br><span class="line">1287</span><br><span class="line">1288</span><br><span class="line">1289</span><br><span class="line">1290</span><br><span class="line">1291</span><br><span class="line">1292</span><br><span class="line">1293</span><br><span class="line">1294</span><br><span class="line">1295</span><br><span class="line">1296</span><br><span class="line">1297</span><br><span class="line">1298</span><br><span class="line">1299</span><br><span class="line">1300</span><br><span class="line">1301</span><br><span class="line">1302</span><br><span class="line">1303</span><br><span class="line">1304</span><br><span class="line">1305</span><br><span class="line">1306</span><br><span class="line">1307</span><br><span class="line">1308</span><br><span class="line">1309</span><br><span class="line">1310</span><br><span class="line">1311</span><br><span class="line">1312</span><br><span class="line">1313</span><br><span class="line">1314</span><br><span class="line">1315</span><br><span class="line">1316</span><br><span class="line">1317</span><br><span class="line">1318</span><br><span class="line">1319</span><br><span class="line">1320</span><br><span class="line">1321</span><br><span class="line">1322</span><br><span class="line">1323</span><br><span class="line">1324</span><br><span class="line">1325</span><br><span class="line">1326</span><br><span class="line">1327</span><br><span class="line">1328</span><br><span class="line">1329</span><br><span class="line">1330</span><br><span class="line">1331</span><br><span class="line">1332</span><br><span class="line">1333</span><br><span class="line">1334</span><br><span class="line">1335</span><br><span class="line">1336</span><br><span class="line">1337</span><br><span class="line">1338</span><br><span class="line">1339</span><br><span class="line">1340</span><br><span class="line">1341</span><br><span class="line">1342</span><br><span class="line">1343</span><br><span class="line">1344</span><br><span class="line">1345</span><br><span class="line">1346</span><br><span class="line">1347</span><br><span class="line">1348</span><br><span class="line">1349</span><br><span class="line">1350</span><br><span class="line">1351</span><br><span class="line">1352</span><br><span class="line">1353</span><br><span class="line">1354</span><br><span class="line">1355</span><br><span class="line">1356</span><br><span class="line">1357</span><br><span class="line">1358</span><br><span class="line">1359</span><br><span class="line">1360</span><br><span class="line">1361</span><br><span class="line">1362</span><br><span class="line">1363</span><br><span class="line">1364</span><br><span class="line">1365</span><br><span class="line">1366</span><br><span class="line">1367</span><br><span class="line">1368</span><br><span class="line">1369</span><br><span class="line">1370</span><br><span class="line">1371</span><br><span class="line">1372</span><br><span class="line">1373</span><br><span class="line">1374</span><br><span class="line">1375</span><br><span class="line">1376</span><br><span class="line">1377</span><br><span class="line">1378</span><br><span class="line">1379</span><br><span class="line">1380</span><br><span class="line">1381</span><br><span class="line">1382</span><br><span class="line">1383</span><br><span class="line">1384</span><br><span class="line">1385</span><br><span class="line">1386</span><br><span class="line">1387</span><br><span class="line">1388</span><br><span class="line">1389</span><br><span class="line">1390</span><br><span class="line">1391</span><br><span class="line">1392</span><br><span class="line">1393</span><br><span class="line">1394</span><br><span class="line">1395</span><br><span class="line">1396</span><br><span class="line">1397</span><br><span class="line">1398</span><br><span class="line">1399</span><br><span class="line">1400</span><br><span class="line">1401</span><br><span class="line">1402</span><br><span class="line">1403</span><br><span class="line">1404</span><br><span class="line">1405</span><br><span class="line">1406</span><br><span class="line">1407</span><br><span class="line">1408</span><br><span class="line">1409</span><br><span class="line">1410</span><br><span class="line">1411</span><br><span class="line">1412</span><br><span class="line">1413</span><br><span class="line">1414</span><br><span class="line">1415</span><br><span class="line">1416</span><br><span class="line">1417</span><br><span class="line">1418</span><br><span class="line">1419</span><br><span class="line">1420</span><br><span class="line">1421</span><br><span class="line">1422</span><br><span class="line">1423</span><br><span class="line">1424</span><br><span class="line">1425</span><br><span class="line">1426</span><br><span class="line">1427</span><br><span class="line">1428</span><br><span class="line">1429</span><br><span class="line">1430</span><br><span class="line">1431</span><br><span class="line">1432</span><br><span class="line">1433</span><br><span class="line">1434</span><br><span class="line">1435</span><br><span class="line">1436</span><br><span class="line">1437</span><br><span class="line">1438</span><br><span class="line">1439</span><br><span class="line">1440</span><br><span class="line">1441</span><br><span class="line">1442</span><br><span class="line">1443</span><br><span class="line">1444</span><br><span class="line">1445</span><br><span class="line">1446</span><br><span class="line">1447</span><br><span class="line">1448</span><br><span class="line">1449</span><br><span class="line">1450</span><br><span class="line">1451</span><br><span class="line">1452</span><br><span class="line">1453</span><br><span class="line">1454</span><br><span class="line">1455</span><br><span class="line">1456</span><br><span class="line">1457</span><br><span class="line">1458</span><br><span class="line">1459</span><br><span class="line">1460</span><br><span class="line">1461</span><br><span class="line">1462</span><br><span class="line">1463</span><br><span class="line">1464</span><br><span class="line">1465</span><br><span class="line">1466</span><br><span class="line">1467</span><br><span class="line">1468</span><br><span class="line">1469</span><br><span class="line">1470</span><br><span class="line">1471</span><br><span class="line">1472</span><br><span class="line">1473</span><br><span class="line">1474</span><br><span class="line">1475</span><br><span class="line">1476</span><br><span class="line">1477</span><br><span class="line">1478</span><br><span class="line">1479</span><br><span class="line">1480</span><br><span class="line">1481</span><br><span class="line">1482</span><br><span class="line">1483</span><br><span class="line">1484</span><br><span class="line">1485</span><br><span class="line">1486</span><br><span class="line">1487</span><br><span class="line">1488</span><br><span class="line">1489</span><br><span class="line">1490</span><br><span class="line">1491</span><br><span class="line">1492</span><br><span class="line">1493</span><br><span class="line">1494</span><br><span class="line">1495</span><br><span class="line">1496</span><br><span class="line">1497</span><br><span class="line">1498</span><br><span class="line">1499</span><br><span class="line">1500</span><br><span class="line">1501</span><br><span class="line">1502</span><br><span class="line">1503</span><br><span class="line">1504</span><br><span class="line">1505</span><br><span class="line">1506</span><br><span class="line">1507</span><br><span class="line">1508</span><br><span class="line">1509</span><br><span class="line">1510</span><br><span class="line">1511</span><br><span class="line">1512</span><br><span class="line">1513</span><br><span class="line">1514</span><br><span class="line">1515</span><br><span class="line">1516</span><br><span class="line">1517</span><br><span class="line">1518</span><br><span class="line">1519</span><br><span class="line">1520</span><br><span class="line">1521</span><br><span class="line">1522</span><br><span class="line">1523</span><br><span class="line">1524</span><br><span class="line">1525</span><br><span class="line">1526</span><br><span class="line">1527</span><br><span class="line">1528</span><br><span class="line">1529</span><br><span class="line">1530</span><br><span class="line">1531</span><br><span class="line">1532</span><br><span class="line">1533</span><br><span class="line">1534</span><br><span class="line">1535</span><br><span class="line">1536</span><br><span class="line">1537</span><br><span class="line">1538</span><br><span class="line">1539</span><br><span class="line">1540</span><br><span class="line">1541</span><br><span class="line">1542</span><br><span class="line">1543</span><br><span class="line">1544</span><br><span class="line">1545</span><br><span class="line">1546</span><br><span class="line">1547</span><br><span class="line">1548</span><br><span class="line">1549</span><br><span class="line">1550</span><br><span class="line">1551</span><br><span class="line">1552</span><br><span class="line">1553</span><br><span class="line">1554</span><br><span class="line">1555</span><br><span class="line">1556</span><br><span class="line">1557</span><br><span class="line">1558</span><br><span class="line">1559</span><br><span class="line">1560</span><br><span class="line">1561</span><br><span class="line">1562</span><br><span class="line">1563</span><br><span class="line">1564</span><br><span class="line">1565</span><br><span class="line">1566</span><br><span class="line">1567</span><br><span class="line">1568</span><br><span class="line">1569</span><br><span class="line">1570</span><br><span class="line">1571</span><br><span class="line">1572</span><br><span class="line">1573</span><br><span class="line">1574</span><br><span class="line">1575</span><br><span class="line">1576</span><br><span class="line">1577</span><br><span class="line">1578</span><br><span class="line">1579</span><br><span class="line">1580</span><br><span class="line">1581</span><br><span class="line">1582</span><br><span class="line">1583</span><br><span class="line">1584</span><br><span class="line">1585</span><br><span class="line">1586</span><br><span class="line">1587</span><br><span class="line">1588</span><br><span class="line">1589</span><br><span class="line">1590</span><br><span class="line">1591</span><br><span class="line">1592</span><br><span class="line">1593</span><br><span class="line">1594</span><br><span class="line">1595</span><br><span class="line">1596</span><br><span class="line">1597</span><br><span class="line">1598</span><br><span class="line">1599</span><br><span class="line">1600</span><br><span class="line">1601</span><br><span class="line">1602</span><br><span class="line">1603</span><br><span class="line">1604</span><br><span class="line">1605</span><br><span class="line">1606</span><br><span class="line">1607</span><br><span class="line">1608</span><br><span class="line">1609</span><br><span class="line">1610</span><br><span class="line">1611</span><br><span class="line">1612</span><br><span class="line">1613</span><br><span class="line">1614</span><br><span class="line">1615</span><br><span class="line">1616</span><br><span class="line">1617</span><br><span class="line">1618</span><br><span class="line">1619</span><br><span class="line">1620</span><br><span class="line">1621</span><br><span class="line">1622</span><br><span class="line">1623</span><br><span class="line">1624</span><br><span class="line">1625</span><br><span class="line">1626</span><br><span class="line">1627</span><br><span class="line">1628</span><br><span class="line">1629</span><br><span class="line">1630</span><br><span class="line">1631</span><br><span class="line">1632</span><br><span class="line">1633</span><br><span class="line">1634</span><br><span class="line">1635</span><br><span class="line">1636</span><br><span class="line">1637</span><br><span class="line">1638</span><br><span class="line">1639</span><br><span class="line">1640</span><br><span class="line">1641</span><br><span class="line">1642</span><br><span class="line">1643</span><br><span class="line">1644</span><br><span class="line">1645</span><br><span class="line">1646</span><br><span class="line">1647</span><br><span class="line">1648</span><br><span class="line">1649</span><br><span class="line">1650</span><br><span class="line">1651</span><br><span class="line">1652</span><br><span class="line">1653</span><br><span class="line">1654</span><br><span class="line">1655</span><br><span class="line">1656</span><br><span class="line">1657</span><br><span class="line">1658</span><br><span class="line">1659</span><br><span class="line">1660</span><br><span class="line">1661</span><br><span class="line">1662</span><br><span class="line">1663</span><br><span class="line">1664</span><br><span class="line">1665</span><br><span class="line">1666</span><br><span class="line">1667</span><br><span class="line">1668</span><br><span class="line">1669</span><br><span class="line">1670</span><br><span class="line">1671</span><br><span class="line">1672</span><br><span class="line">1673</span><br><span class="line">1674</span><br><span class="line">1675</span><br><span class="line">1676</span><br><span class="line">1677</span><br><span class="line">1678</span><br><span class="line">1679</span><br><span class="line">1680</span><br><span class="line">1681</span><br><span class="line">1682</span><br><span class="line">1683</span><br><span class="line">1684</span><br><span class="line">1685</span><br><span class="line">1686</span><br><span class="line">1687</span><br><span class="line">1688</span><br><span class="line">1689</span><br><span class="line">1690</span><br><span class="line">1691</span><br><span class="line">1692</span><br><span class="line">1693</span><br><span class="line">1694</span><br><span class="line">1695</span><br><span class="line">1696</span><br><span class="line">1697</span><br><span class="line">1698</span><br><span class="line">1699</span><br><span class="line">1700</span><br><span class="line">1701</span><br><span class="line">1702</span><br><span class="line">1703</span><br><span class="line">1704</span><br><span class="line">1705</span><br><span class="line">1706</span><br><span class="line">1707</span><br><span class="line">1708</span><br><span class="line">1709</span><br><span class="line">1710</span><br><span class="line">1711</span><br><span class="line">1712</span><br><span class="line">1713</span><br><span class="line">1714</span><br><span class="line">1715</span><br><span class="line">1716</span><br><span class="line">1717</span><br><span class="line">1718</span><br><span class="line">1719</span><br><span class="line">1720</span><br><span class="line">1721</span><br><span class="line">1722</span><br><span class="line">1723</span><br><span class="line">1724</span><br><span class="line">1725</span><br><span class="line">1726</span><br><span class="line">1727</span><br><span class="line">1728</span><br><span class="line">1729</span><br><span class="line">1730</span><br><span class="line">1731</span><br><span class="line">1732</span><br><span class="line">1733</span><br><span class="line">1734</span><br><span class="line">1735</span><br><span class="line">1736</span><br><span class="line">1737</span><br><span class="line">1738</span><br><span class="line">1739</span><br><span class="line">1740</span><br><span class="line">1741</span><br><span class="line">1742</span><br><span class="line">1743</span><br><span class="line">1744</span><br><span class="line">1745</span><br><span class="line">1746</span><br><span class="line">1747</span><br><span class="line">1748</span><br><span class="line">1749</span><br><span class="line">1750</span><br><span class="line">1751</span><br><span class="line">1752</span><br><span class="line">1753</span><br><span class="line">1754</span><br><span class="line">1755</span><br><span class="line">1756</span><br><span class="line">1757</span><br><span class="line">1758</span><br><span class="line">1759</span><br><span class="line">1760</span><br><span class="line">1761</span><br><span class="line">1762</span><br><span class="line">1763</span><br><span class="line">1764</span><br><span class="line">1765</span><br><span class="line">1766</span><br><span class="line">1767</span><br><span class="line">1768</span><br><span class="line">1769</span><br><span class="line">1770</span><br><span class="line">1771</span><br><span class="line">1772</span><br><span class="line">1773</span><br><span class="line">1774</span><br><span class="line">1775</span><br><span class="line">1776</span><br><span class="line">1777</span><br><span class="line">1778</span><br><span class="line">1779</span><br><span class="line">1780</span><br><span class="line">1781</span><br><span class="line">1782</span><br><span class="line">1783</span><br><span class="line">1784</span><br><span class="line">1785</span><br><span class="line">1786</span><br><span class="line">1787</span><br><span class="line">1788</span><br><span class="line">1789</span><br><span class="line">1790</span><br><span class="line">1791</span><br><span class="line">1792</span><br><span class="line">1793</span><br><span class="line">1794</span><br><span class="line">1795</span><br><span class="line">1796</span><br><span class="line">1797</span><br><span class="line">1798</span><br><span class="line">1799</span><br><span class="line">1800</span><br><span class="line">1801</span><br><span class="line">1802</span><br><span class="line">1803</span><br><span class="line">1804</span><br><span class="line">1805</span><br><span class="line">1806</span><br><span class="line">1807</span><br><span class="line">1808</span><br><span class="line">1809</span><br><span class="line">1810</span><br><span class="line">1811</span><br><span class="line">1812</span><br><span class="line">1813</span><br><span class="line">1814</span><br><span class="line">1815</span><br><span class="line">1816</span><br><span class="line">1817</span><br><span class="line">1818</span><br><span class="line">1819</span><br><span class="line">1820</span><br><span class="line">1821</span><br><span class="line">1822</span><br><span class="line">1823</span><br><span class="line">1824</span><br><span class="line">1825</span><br><span class="line">1826</span><br><span class="line">1827</span><br><span class="line">1828</span><br><span class="line">1829</span><br><span class="line">1830</span><br><span class="line">1831</span><br><span class="line">1832</span><br><span class="line">1833</span><br><span class="line">1834</span><br><span class="line">1835</span><br><span class="line">1836</span><br><span class="line">1837</span><br><span class="line">1838</span><br><span class="line">1839</span><br><span class="line">1840</span><br><span class="line">1841</span><br><span class="line">1842</span><br><span class="line">1843</span><br><span class="line">1844</span><br><span class="line">1845</span><br><span class="line">1846</span><br><span class="line">1847</span><br><span class="line">1848</span><br><span class="line">1849</span><br><span class="line">1850</span><br><span class="line">1851</span><br><span class="line">1852</span><br><span class="line">1853</span><br><span class="line">1854</span><br><span class="line">1855</span><br><span class="line">1856</span><br><span class="line">1857</span><br><span class="line">1858</span><br><span class="line">1859</span><br><span class="line">1860</span><br><span class="line">1861</span><br><span class="line">1862</span><br><span class="line">1863</span><br><span class="line">1864</span><br><span class="line">1865</span><br><span class="line">1866</span><br><span class="line">1867</span><br><span class="line">1868</span><br><span class="line">1869</span><br><span class="line">1870</span><br><span class="line">1871</span><br><span class="line">1872</span><br><span class="line">1873</span><br><span class="line">1874</span><br><span class="line">1875</span><br><span class="line">1876</span><br><span class="line">1877</span><br><span class="line">1878</span><br><span class="line">1879</span><br><span class="line">1880</span><br><span class="line">1881</span><br><span class="line">1882</span><br><span class="line">1883</span><br><span class="line">1884</span><br><span class="line">1885</span><br><span class="line">1886</span><br><span class="line">1887</span><br><span class="line">1888</span><br><span class="line">1889</span><br><span class="line">1890</span><br><span class="line">1891</span><br><span class="line">1892</span><br><span class="line">1893</span><br><span class="line">1894</span><br><span class="line">1895</span><br><span class="line">1896</span><br><span class="line">1897</span><br><span class="line">1898</span><br><span class="line">1899</span><br><span class="line">1900</span><br><span class="line">1901</span><br><span class="line">1902</span><br><span class="line">1903</span><br><span class="line">1904</span><br><span class="line">1905</span><br><span class="line">1906</span><br><span class="line">1907</span><br><span class="line">1908</span><br><span class="line">1909</span><br><span class="line">1910</span><br><span class="line">1911</span><br><span class="line">1912</span><br><span class="line">1913</span><br><span class="line">1914</span><br><span class="line">1915</span><br><span class="line">1916</span><br><span class="line">1917</span><br><span class="line">1918</span><br><span class="line">1919</span><br><span class="line">1920</span><br><span class="line">1921</span><br><span class="line">1922</span><br><span class="line">1923</span><br><span class="line">1924</span><br><span class="line">1925</span><br><span class="line">1926</span><br><span class="line">1927</span><br><span class="line">1928</span><br><span class="line">1929</span><br><span class="line">1930</span><br><span class="line">1931</span><br><span class="line">1932</span><br><span class="line">1933</span><br><span class="line">1934</span><br><span class="line">1935</span><br><span class="line">1936</span><br><span class="line">1937</span><br><span class="line">1938</span><br><span class="line">1939</span><br><span class="line">1940</span><br><span class="line">1941</span><br><span class="line">1942</span><br><span class="line">1943</span><br><span class="line">1944</span><br><span class="line">1945</span><br><span class="line">1946</span><br><span class="line">1947</span><br><span class="line">1948</span><br><span class="line">1949</span><br><span class="line">1950</span><br><span class="line">1951</span><br><span class="line">1952</span><br><span class="line">1953</span><br><span class="line">1954</span><br><span class="line">1955</span><br><span class="line">1956</span><br><span class="line">1957</span><br><span class="line">1958</span><br><span class="line">1959</span><br><span class="line">1960</span><br><span class="line">1961</span><br><span class="line">1962</span><br><span class="line">1963</span><br><span class="line">1964</span><br><span class="line">1965</span><br><span class="line">1966</span><br><span class="line">1967</span><br><span class="line">1968</span><br><span class="line">1969</span><br><span class="line">1970</span><br><span class="line">1971</span><br><span class="line">1972</span><br><span class="line">1973</span><br><span class="line">1974</span><br><span class="line">1975</span><br><span class="line">1976</span><br><span class="line">1977</span><br><span class="line">1978</span><br><span class="line">1979</span><br><span class="line">1980</span><br><span class="line">1981</span><br><span class="line">1982</span><br><span class="line">1983</span><br><span class="line">1984</span><br><span class="line">1985</span><br><span class="line">1986</span><br><span class="line">1987</span><br><span class="line">1988</span><br><span class="line">1989</span><br><span class="line">1990</span><br><span class="line">1991</span><br><span class="line">1992</span><br><span class="line">1993</span><br><span class="line">1994</span><br><span class="line">1995</span><br><span class="line">1996</span><br><span class="line">1997</span><br><span class="line">1998</span><br><span class="line">1999</span><br><span class="line">2000</span><br><span class="line">2001</span><br><span class="line">2002</span><br><span class="line">2003</span><br><span class="line">2004</span><br><span class="line">2005</span><br><span class="line">2006</span><br><span class="line">2007</span><br><span class="line">2008</span><br><span class="line">2009</span><br><span class="line">2010</span><br><span class="line">2011</span><br><span class="line">2012</span><br><span class="line">2013</span><br><span class="line">2014</span><br><span class="line">2015</span><br><span class="line">2016</span><br><span class="line">2017</span><br><span class="line">2018</span><br><span class="line">2019</span><br><span class="line">2020</span><br><span class="line">2021</span><br><span class="line">2022</span><br><span class="line">2023</span><br><span class="line">2024</span><br><span class="line">2025</span><br><span class="line">2026</span><br><span class="line">2027</span><br><span class="line">2028</span><br><span class="line">2029</span><br><span class="line">2030</span><br><span class="line">2031</span><br><span class="line">2032</span><br><span class="line">2033</span><br><span class="line">2034</span><br><span class="line">2035</span><br><span class="line">2036</span><br><span class="line">2037</span><br><span class="line">2038</span><br><span class="line">2039</span><br><span class="line">2040</span><br><span class="line">2041</span><br><span class="line">2042</span><br><span class="line">2043</span><br><span class="line">2044</span><br><span class="line">2045</span><br><span class="line">2046</span><br><span class="line">2047</span><br><span class="line">2048</span><br><span class="line">2049</span><br><span class="line">2050</span><br><span class="line">2051</span><br><span class="line">2052</span><br><span class="line">2053</span><br><span class="line">2054</span><br><span class="line">2055</span><br><span class="line">2056</span><br><span class="line">2057</span><br><span class="line">2058</span><br><span class="line">2059</span><br><span class="line">2060</span><br><span class="line">2061</span><br><span class="line">2062</span><br><span class="line">2063</span><br><span class="line">2064</span><br><span class="line">2065</span><br><span class="line">2066</span><br><span class="line">2067</span><br><span class="line">2068</span><br><span class="line">2069</span><br><span class="line">2070</span><br><span class="line">2071</span><br><span class="line">2072</span><br><span class="line">2073</span><br><span class="line">2074</span><br><span class="line">2075</span><br><span class="line">2076</span><br><span class="line">2077</span><br><span class="line">2078</span><br><span class="line">2079</span><br><span class="line">2080</span><br><span class="line">2081</span><br><span class="line">2082</span><br><span class="line">2083</span><br><span class="line">2084</span><br><span class="line">2085</span><br><span class="line">2086</span><br><span class="line">2087</span><br><span class="line">2088</span><br><span class="line">2089</span><br><span class="line">2090</span><br><span class="line">2091</span><br><span class="line">2092</span><br><span class="line">2093</span><br><span class="line">2094</span><br><span class="line">2095</span><br><span class="line">2096</span><br><span class="line">2097</span><br><span class="line">2098</span><br><span class="line">2099</span><br><span class="line">2100</span><br><span class="line">2101</span><br><span class="line">2102</span><br><span class="line">2103</span><br><span class="line">2104</span><br><span class="line">2105</span><br><span class="line">2106</span><br><span class="line">2107</span><br><span class="line">2108</span><br><span class="line">2109</span><br><span class="line">2110</span><br><span class="line">2111</span><br><span class="line">2112</span><br><span class="line">2113</span><br><span class="line">2114</span><br><span class="line">2115</span><br><span class="line">2116</span><br><span class="line">2117</span><br><span class="line">2118</span><br><span class="line">2119</span><br><span class="line">2120</span><br><span class="line">2121</span><br><span class="line">2122</span><br><span class="line">2123</span><br><span class="line">2124</span><br><span class="line">2125</span><br><span class="line">2126</span><br><span class="line">2127</span><br><span class="line">2128</span><br><span class="line">2129</span><br><span class="line">2130</span><br><span class="line">2131</span><br><span class="line">2132</span><br><span class="line">2133</span><br><span class="line">2134</span><br><span class="line">2135</span><br><span class="line">2136</span><br><span class="line">2137</span><br><span class="line">2138</span><br><span class="line">2139</span><br><span class="line">2140</span><br><span class="line">2141</span><br><span class="line">2142</span><br><span class="line">2143</span><br><span class="line">2144</span><br><span class="line">2145</span><br><span class="line">2146</span><br><span class="line">2147</span><br><span class="line">2148</span><br><span class="line">2149</span><br><span class="line">2150</span><br><span class="line">2151</span><br><span class="line">2152</span><br><span class="line">2153</span><br><span class="line">2154</span><br><span class="line">2155</span><br><span class="line">2156</span><br><span class="line">2157</span><br><span class="line">2158</span><br><span class="line">2159</span><br><span class="line">2160</span><br><span class="line">2161</span><br><span class="line">2162</span><br><span class="line">2163</span><br><span class="line">2164</span><br><span class="line">2165</span><br><span class="line">2166</span><br><span class="line">2167</span><br><span class="line">2168</span><br><span class="line">2169</span><br><span class="line">2170</span><br><span class="line">2171</span><br><span class="line">2172</span><br><span class="line">2173</span><br><span class="line">2174</span><br><span class="line">2175</span><br><span class="line">2176</span><br><span class="line">2177</span><br><span class="line">2178</span><br><span class="line">2179</span><br><span class="line">2180</span><br><span class="line">2181</span><br><span class="line">2182</span><br><span class="line">2183</span><br><span class="line">2184</span><br><span class="line">2185</span><br><span class="line">2186</span><br><span class="line">2187</span><br><span class="line">2188</span><br><span class="line">2189</span><br><span class="line">2190</span><br><span class="line">2191</span><br><span class="line">2192</span><br><span class="line">2193</span><br><span class="line">2194</span><br><span class="line">2195</span><br><span class="line">2196</span><br><span class="line">2197</span><br><span class="line">2198</span><br><span class="line">2199</span><br><span class="line">2200</span><br><span class="line">2201</span><br><span class="line">2202</span><br><span class="line">2203</span><br><span class="line">2204</span><br><span class="line">2205</span><br><span class="line">2206</span><br><span class="line">2207</span><br><span class="line">2208</span><br><span class="line">2209</span><br><span class="line">2210</span><br><span class="line">2211</span><br><span class="line">2212</span><br><span class="line">2213</span><br><span class="line">2214</span><br><span class="line">2215</span><br><span class="line">2216</span><br><span class="line">2217</span><br><span class="line">2218</span><br><span class="line">2219</span><br><span class="line">2220</span><br><span class="line">2221</span><br><span class="line">2222</span><br><span class="line">2223</span><br><span class="line">2224</span><br><span class="line">2225</span><br><span class="line">2226</span><br><span class="line">2227</span><br><span class="line">2228</span><br><span class="line">2229</span><br><span class="line">2230</span><br><span class="line">2231</span><br><span class="line">2232</span><br><span class="line">2233</span><br><span class="line">2234</span><br><span class="line">2235</span><br><span class="line">2236</span><br><span class="line">2237</span><br><span class="line">2238</span><br><span class="line">2239</span><br><span class="line">2240</span><br><span class="line">2241</span><br><span class="line">2242</span><br><span class="line">2243</span><br><span class="line">2244</span><br><span class="line">2245</span><br><span class="line">2246</span><br><span class="line">2247</span><br><span class="line">2248</span><br><span class="line">2249</span><br><span class="line">2250</span><br><span class="line">2251</span><br><span class="line">2252</span><br><span class="line">2253</span><br><span class="line">2254</span><br><span class="line">2255</span><br><span class="line">2256</span><br><span class="line">2257</span><br><span class="line">2258</span><br><span class="line">2259</span><br><span class="line">2260</span><br><span class="line">2261</span><br><span class="line">2262</span><br><span class="line">2263</span><br><span class="line">2264</span><br><span class="line">2265</span><br><span class="line">2266</span><br><span class="line">2267</span><br><span class="line">2268</span><br><span class="line">2269</span><br><span class="line">2270</span><br><span class="line">2271</span><br><span class="line">2272</span><br><span class="line">2273</span><br><span class="line">2274</span><br><span class="line">2275</span><br><span class="line">2276</span><br><span class="line">2277</span><br><span class="line">2278</span><br><span class="line">2279</span><br><span class="line">2280</span><br><span class="line">2281</span><br><span class="line">2282</span><br><span class="line">2283</span><br><span class="line">2284</span><br><span class="line">2285</span><br><span class="line">2286</span><br><span class="line">2287</span><br><span class="line">2288</span><br><span class="line">2289</span><br><span class="line">2290</span><br><span class="line">2291</span><br><span class="line">2292</span><br><span class="line">2293</span><br><span class="line">2294</span><br><span class="line">2295</span><br><span class="line">2296</span><br><span class="line">2297</span><br><span class="line">2298</span><br><span class="line">2299</span><br><span class="line">2300</span><br><span class="line">2301</span><br><span class="line">2302</span><br><span class="line">2303</span><br><span class="line">2304</span><br><span class="line">2305</span><br><span class="line">2306</span><br><span class="line">2307</span><br><span class="line">2308</span><br><span class="line">2309</span><br><span class="line">2310</span><br><span class="line">2311</span><br><span class="line">2312</span><br><span class="line">2313</span><br><span class="line">2314</span><br><span class="line">2315</span><br><span class="line">2316</span><br><span class="line">2317</span><br><span class="line">2318</span><br><span class="line">2319</span><br><span class="line">2320</span><br><span class="line">2321</span><br><span class="line">2322</span><br><span class="line">2323</span><br><span class="line">2324</span><br><span class="line">2325</span><br><span class="line">2326</span><br><span class="line">2327</span><br><span class="line">2328</span><br><span class="line">2329</span><br><span class="line">2330</span><br><span class="line">2331</span><br><span class="line">2332</span><br><span class="line">2333</span><br><span class="line">2334</span><br><span class="line">2335</span><br><span class="line">2336</span><br><span class="line">2337</span><br><span class="line">2338</span><br><span class="line">2339</span><br><span class="line">2340</span><br><span class="line">2341</span><br><span class="line">2342</span><br><span class="line">2343</span><br><span class="line">2344</span><br><span class="line">2345</span><br><span class="line">2346</span><br><span class="line">2347</span><br><span class="line">2348</span><br><span class="line">2349</span><br><span class="line">2350</span><br><span class="line">2351</span><br><span class="line">2352</span><br><span class="line">2353</span><br><span class="line">2354</span><br><span class="line">2355</span><br><span class="line">2356</span><br><span class="line">2357</span><br><span class="line">2358</span><br><span class="line">2359</span><br><span class="line">2360</span><br><span class="line">2361</span><br><span class="line">2362</span><br><span class="line">2363</span><br><span class="line">2364</span><br><span class="line">2365</span><br><span class="line">2366</span><br><span class="line">2367</span><br><span class="line">2368</span><br><span class="line">2369</span><br><span class="line">2370</span><br><span class="line">2371</span><br><span class="line">2372</span><br><span class="line">2373</span><br><span class="line">2374</span><br><span class="line">2375</span><br><span class="line">2376</span><br><span class="line">2377</span><br><span class="line">2378</span><br><span class="line">2379</span><br><span class="line">2380</span><br><span class="line">2381</span><br><span class="line">2382</span><br><span class="line">2383</span><br><span class="line">2384</span><br><span class="line">2385</span><br><span class="line">2386</span><br><span class="line">2387</span><br><span class="line">2388</span><br><span class="line">2389</span><br><span class="line">2390</span><br><span class="line">2391</span><br><span class="line">2392</span><br><span class="line">2393</span><br><span class="line">2394</span><br><span class="line">2395</span><br><span class="line">2396</span><br><span class="line">2397</span><br><span class="line">2398</span><br><span class="line">2399</span><br><span class="line">2400</span><br><span class="line">2401</span><br><span class="line">2402</span><br><span class="line">2403</span><br><span class="line">2404</span><br><span class="line">2405</span><br><span class="line">2406</span><br><span class="line">2407</span><br><span class="line">2408</span><br><span class="line">2409</span><br><span class="line">2410</span><br><span class="line">2411</span><br><span class="line">2412</span><br><span class="line">2413</span><br><span class="line">2414</span><br><span class="line">2415</span><br><span class="line">2416</span><br><span class="line">2417</span><br><span class="line">2418</span><br><span class="line">2419</span><br><span class="line">2420</span><br><span class="line">2421</span><br><span class="line">2422</span><br><span class="line">2423</span><br><span class="line">2424</span><br><span class="line">2425</span><br><span class="line">2426</span><br><span class="line">2427</span><br><span class="line">2428</span><br><span class="line">2429</span><br><span class="line">2430</span><br><span class="line">2431</span><br><span class="line">2432</span><br><span class="line">2433</span><br><span class="line">2434</span><br><span class="line">2435</span><br><span class="line">2436</span><br><span class="line">2437</span><br><span class="line">2438</span><br><span class="line">2439</span><br><span class="line">2440</span><br><span class="line">2441</span><br><span class="line">2442</span><br><span class="line">2443</span><br><span class="line">2444</span><br><span class="line">2445</span><br><span class="line">2446</span><br><span class="line">2447</span><br><span class="line">2448</span><br><span class="line">2449</span><br><span class="line">2450</span><br><span class="line">2451</span><br><span class="line">2452</span><br><span class="line">2453</span><br><span class="line">2454</span><br><span class="line">2455</span><br><span class="line">2456</span><br><span class="line">2457</span><br><span class="line">2458</span><br><span class="line">2459</span><br><span class="line">2460</span><br><span class="line">2461</span><br><span class="line">2462</span><br><span class="line">2463</span><br><span class="line">2464</span><br><span class="line">2465</span><br><span class="line">2466</span><br><span class="line">2467</span><br><span class="line">2468</span><br><span class="line">2469</span><br><span class="line">2470</span><br><span class="line">2471</span><br><span class="line">2472</span><br><span class="line">2473</span><br><span class="line">2474</span><br><span class="line">2475</span><br><span class="line">2476</span><br><span class="line">2477</span><br><span class="line">2478</span><br><span class="line">2479</span><br><span class="line">2480</span><br><span class="line">2481</span><br><span class="line">2482</span><br><span class="line">2483</span><br><span class="line">2484</span><br><span class="line">2485</span><br><span class="line">2486</span><br><span class="line">2487</span><br><span class="line">2488</span><br><span class="line">2489</span><br><span class="line">2490</span><br><span class="line">2491</span><br><span class="line">2492</span><br><span class="line">2493</span><br><span class="line">2494</span><br><span class="line">2495</span><br><span class="line">2496</span><br><span class="line">2497</span><br><span class="line">2498</span><br><span class="line">2499</span><br><span class="line">2500</span><br><span class="line">2501</span><br><span class="line">2502</span><br><span class="line">2503</span><br><span class="line">2504</span><br><span class="line">2505</span><br><span class="line">2506</span><br><span class="line">2507</span><br><span class="line">2508</span><br><span class="line">2509</span><br><span class="line">2510</span><br><span class="line">2511</span><br><span class="line">2512</span><br><span class="line">2513</span><br><span class="line">2514</span><br><span class="line">2515</span><br><span class="line">2516</span><br><span class="line">2517</span><br><span class="line">2518</span><br><span class="line">2519</span><br><span class="line">2520</span><br><span class="line">2521</span><br><span class="line">2522</span><br><span class="line">2523</span><br><span class="line">2524</span><br><span class="line">2525</span><br><span class="line">2526</span><br><span class="line">2527</span><br><span class="line">2528</span><br><span class="line">2529</span><br><span class="line">2530</span><br><span class="line">2531</span><br><span class="line">2532</span><br><span class="line">2533</span><br><span class="line">2534</span><br><span class="line">2535</span><br><span class="line">2536</span><br><span class="line">2537</span><br><span class="line">2538</span><br><span class="line">2539</span><br><span class="line">2540</span><br><span class="line">2541</span><br><span class="line">2542</span><br><span class="line">2543</span><br><span class="line">2544</span><br><span class="line">2545</span><br><span class="line">2546</span><br><span class="line">2547</span><br><span class="line">2548</span><br><span class="line">2549</span><br><span class="line">2550</span><br><span class="line">2551</span><br><span class="line">2552</span><br><span class="line">2553</span><br><span class="line">2554</span><br><span class="line">2555</span><br><span class="line">2556</span><br><span class="line">2557</span><br><span class="line">2558</span><br><span class="line">2559</span><br><span class="line">2560</span><br><span class="line">2561</span><br><span class="line">2562</span><br><span class="line">2563</span><br><span class="line">2564</span><br><span class="line">2565</span><br><span class="line">2566</span><br><span class="line">2567</span><br><span class="line">2568</span><br><span class="line">2569</span><br><span class="line">2570</span><br><span class="line">2571</span><br><span class="line">2572</span><br><span class="line">2573</span><br><span class="line">2574</span><br><span class="line">2575</span><br><span class="line">2576</span><br><span class="line">2577</span><br><span class="line">2578</span><br><span class="line">2579</span><br><span class="line">2580</span><br><span class="line">2581</span><br><span class="line">2582</span><br><span class="line">2583</span><br><span class="line">2584</span><br><span class="line">2585</span><br><span class="line">2586</span><br><span class="line">2587</span><br><span class="line">2588</span><br><span class="line">2589</span><br><span class="line">2590</span><br><span class="line">2591</span><br><span class="line">2592</span><br><span class="line">2593</span><br><span class="line">2594</span><br><span class="line">2595</span><br><span class="line">2596</span><br><span class="line">2597</span><br><span class="line">2598</span><br><span class="line">2599</span><br><span class="line">2600</span><br><span class="line">2601</span><br><span class="line">2602</span><br><span class="line">2603</span><br><span class="line">2604</span><br><span class="line">2605</span><br><span class="line">2606</span><br><span class="line">2607</span><br><span class="line">2608</span><br><span class="line">2609</span><br><span class="line">2610</span><br><span class="line">2611</span><br><span class="line">2612</span><br><span class="line">2613</span><br><span class="line">2614</span><br><span class="line">2615</span><br><span class="line">2616</span><br><span class="line">2617</span><br><span class="line">2618</span><br><span class="line">2619</span><br><span class="line">2620</span><br><span class="line">2621</span><br><span class="line">2622</span><br><span class="line">2623</span><br><span class="line">2624</span><br><span class="line">2625</span><br><span class="line">2626</span><br><span class="line">2627</span><br><span class="line">2628</span><br><span class="line">2629</span><br><span class="line">2630</span><br><span class="line">2631</span><br><span class="line">2632</span><br><span class="line">2633</span><br><span class="line">2634</span><br><span class="line">2635</span><br><span class="line">2636</span><br><span class="line">2637</span><br><span class="line">2638</span><br><span class="line">2639</span><br><span class="line">2640</span><br><span class="line">2641</span><br><span class="line">2642</span><br><span class="line">2643</span><br><span class="line">2644</span><br><span class="line">2645</span><br><span class="line">2646</span><br><span class="line">2647</span><br><span class="line">2648</span><br><span class="line">2649</span><br><span class="line">2650</span><br><span class="line">2651</span><br><span class="line">2652</span><br><span class="line">2653</span><br><span class="line">2654</span><br><span class="line">2655</span><br><span class="line">2656</span><br><span class="line">2657</span><br><span class="line">2658</span><br><span class="line">2659</span><br><span class="line">2660</span><br><span class="line">2661</span><br><span class="line">2662</span><br><span class="line">2663</span><br><span class="line">2664</span><br><span class="line">2665</span><br><span class="line">2666</span><br><span class="line">2667</span><br><span class="line">2668</span><br><span class="line">2669</span><br><span class="line">2670</span><br><span class="line">2671</span><br><span class="line">2672</span><br><span class="line">2673</span><br><span class="line">2674</span><br><span class="line">2675</span><br><span class="line">2676</span><br><span class="line">2677</span><br><span class="line">2678</span><br><span class="line">2679</span><br><span class="line">2680</span><br><span class="line">2681</span><br><span class="line">2682</span><br><span class="line">2683</span><br><span class="line">2684</span><br><span class="line">2685</span><br><span class="line">2686</span><br><span class="line">2687</span><br><span class="line">2688</span><br><span class="line">2689</span><br><span class="line">2690</span><br><span class="line">2691</span><br><span class="line">2692</span><br><span class="line">2693</span><br><span class="line">2694</span><br><span class="line">2695</span><br><span class="line">2696</span><br><span class="line">2697</span><br><span class="line">2698</span><br><span class="line">2699</span><br><span class="line">2700</span><br><span class="line">2701</span><br><span class="line">2702</span><br><span class="line">2703</span><br><span class="line">2704</span><br><span class="line">2705</span><br><span class="line">2706</span><br><span class="line">2707</span><br><span class="line">2708</span><br><span class="line">2709</span><br><span class="line">2710</span><br><span class="line">2711</span><br><span class="line">2712</span><br><span class="line">2713</span><br><span class="line">2714</span><br><span class="line">2715</span><br><span class="line">2716</span><br><span class="line">2717</span><br><span class="line">2718</span><br><span class="line">2719</span><br><span class="line">2720</span><br><span class="line">2721</span><br><span class="line">2722</span><br><span class="line">2723</span><br><span class="line">2724</span><br><span class="line">2725</span><br><span class="line">2726</span><br><span class="line">2727</span><br><span class="line">2728</span><br><span class="line">2729</span><br><span class="line">2730</span><br><span class="line">2731</span><br><span class="line">2732</span><br><span class="line">2733</span><br><span class="line">2734</span><br><span class="line">2735</span><br><span class="line">2736</span><br><span class="line">2737</span><br><span class="line">2738</span><br><span class="line">2739</span><br><span class="line">2740</span><br><span class="line">2741</span><br><span class="line">2742</span><br><span class="line">2743</span><br><span class="line">2744</span><br><span class="line">2745</span><br><span class="line">2746</span><br><span class="line">2747</span><br><span class="line">2748</span><br><span class="line">2749</span><br><span class="line">2750</span><br><span class="line">2751</span><br><span class="line">2752</span><br><span class="line">2753</span><br><span class="line">2754</span><br><span class="line">2755</span><br><span class="line">2756</span><br><span class="line">2757</span><br><span class="line">2758</span><br><span class="line">2759</span><br><span class="line">2760</span><br><span class="line">2761</span><br><span class="line">2762</span><br><span class="line">2763</span><br><span class="line">2764</span><br><span class="line">2765</span><br><span class="line">2766</span><br><span class="line">2767</span><br><span class="line">2768</span><br><span class="line">2769</span><br><span class="line">2770</span><br><span class="line">2771</span><br><span class="line">2772</span><br><span class="line">2773</span><br><span class="line">2774</span><br><span class="line">2775</span><br><span class="line">2776</span><br><span class="line">2777</span><br><span class="line">2778</span><br><span class="line">2779</span><br><span class="line">2780</span><br><span class="line">2781</span><br><span class="line">2782</span><br><span class="line">2783</span><br><span class="line">2784</span><br><span class="line">2785</span><br><span class="line">2786</span><br><span class="line">2787</span><br><span class="line">2788</span><br><span class="line">2789</span><br><span class="line">2790</span><br><span class="line">2791</span><br><span class="line">2792</span><br><span class="line">2793</span><br><span class="line">2794</span><br><span class="line">2795</span><br><span class="line">2796</span><br><span class="line">2797</span><br><span class="line">2798</span><br><span class="line">2799</span><br><span class="line">2800</span><br><span class="line">2801</span><br><span class="line">2802</span><br><span class="line">2803</span><br><span class="line">2804</span><br><span class="line">2805</span><br><span class="line">2806</span><br><span class="line">2807</span><br><span class="line">2808</span><br><span class="line">2809</span><br><span class="line">2810</span><br><span class="line">2811</span><br><span class="line">2812</span><br><span class="line">2813</span><br><span class="line">2814</span><br><span class="line">2815</span><br><span class="line">2816</span><br><span class="line">2817</span><br><span class="line">2818</span><br><span class="line">2819</span><br><span class="line">2820</span><br><span class="line">2821</span><br><span class="line">2822</span><br><span class="line">2823</span><br><span class="line">2824</span><br><span class="line">2825</span><br><span class="line">2826</span><br><span class="line">2827</span><br><span class="line">2828</span><br><span class="line">2829</span><br><span class="line">2830</span><br><span class="line">2831</span><br><span class="line">2832</span><br><span class="line">2833</span><br><span class="line">2834</span><br><span class="line">2835</span><br><span class="line">2836</span><br><span class="line">2837</span><br><span class="line">2838</span><br><span class="line">2839</span><br><span class="line">2840</span><br><span class="line">2841</span><br><span class="line">2842</span><br><span class="line">2843</span><br><span class="line">2844</span><br><span class="line">2845</span><br><span class="line">2846</span><br><span class="line">2847</span><br><span class="line">2848</span><br><span class="line">2849</span><br><span class="line">2850</span><br><span class="line">2851</span><br><span class="line">2852</span><br><span class="line">2853</span><br><span class="line">2854</span><br><span class="line">2855</span><br><span class="line">2856</span><br><span class="line">2857</span><br><span class="line">2858</span><br><span class="line">2859</span><br><span class="line">2860</span><br><span class="line">2861</span><br><span class="line">2862</span><br><span class="line">2863</span><br><span class="line">2864</span><br><span class="line">2865</span><br><span class="line">2866</span><br><span class="line">2867</span><br><span class="line">2868</span><br><span class="line">2869</span><br><span class="line">2870</span><br><span class="line">2871</span><br><span class="line">2872</span><br><span class="line">2873</span><br><span class="line">2874</span><br><span class="line">2875</span><br><span class="line">2876</span><br><span class="line">2877</span><br><span class="line">2878</span><br><span class="line">2879</span><br><span class="line">2880</span><br><span class="line">2881</span><br><span class="line">2882</span><br><span class="line">2883</span><br><span class="line">2884</span><br><span class="line">2885</span><br><span class="line">2886</span><br><span class="line">2887</span><br><span class="line">2888</span><br><span class="line">2889</span><br><span class="line">2890</span><br><span class="line">2891</span><br><span class="line">2892</span><br><span class="line">2893</span><br><span class="line">2894</span><br><span class="line">2895</span><br><span class="line">2896</span><br><span class="line">2897</span><br><span class="line">2898</span><br><span class="line">2899</span><br><span class="line">2900</span><br><span class="line">2901</span><br><span class="line">2902</span><br><span class="line">2903</span><br><span class="line">2904</span><br><span class="line">2905</span><br><span class="line">2906</span><br><span class="line">2907</span><br><span class="line">2908</span><br><span class="line">2909</span><br><span class="line">2910</span><br><span class="line">2911</span><br><span class="line">2912</span><br><span class="line">2913</span><br><span class="line">2914</span><br><span class="line">2915</span><br><span class="line">2916</span><br><span class="line">2917</span><br><span class="line">2918</span><br><span class="line">2919</span><br><span class="line">2920</span><br><span class="line">2921</span><br><span class="line">2922</span><br><span class="line">2923</span><br><span class="line">2924</span><br><span class="line">2925</span><br><span class="line">2926</span><br><span class="line">2927</span><br><span class="line">2928</span><br><span class="line">2929</span><br><span class="line">2930</span><br><span class="line">2931</span><br><span class="line">2932</span><br><span class="line">2933</span><br><span class="line">2934</span><br><span class="line">2935</span><br><span class="line">2936</span><br><span class="line">2937</span><br><span class="line">2938</span><br><span class="line">2939</span><br><span class="line">2940</span><br><span class="line">2941</span><br><span class="line">2942</span><br><span class="line">2943</span><br><span class="line">2944</span><br><span class="line">2945</span><br><span class="line">2946</span><br><span class="line">2947</span><br><span class="line">2948</span><br><span class="line">2949</span><br><span class="line">2950</span><br><span class="line">2951</span><br><span class="line">2952</span><br><span class="line">2953</span><br><span class="line">2954</span><br><span class="line">2955</span><br><span class="line">2956</span><br><span class="line">2957</span><br><span class="line">2958</span><br><span class="line">2959</span><br><span class="line">2960</span><br><span class="line">2961</span><br><span class="line">2962</span><br><span class="line">2963</span><br><span class="line">2964</span><br><span class="line">2965</span><br><span class="line">2966</span><br><span class="line">2967</span><br><span class="line">2968</span><br><span class="line">2969</span><br><span class="line">2970</span><br><span class="line">2971</span><br><span class="line">2972</span><br><span class="line">2973</span><br><span class="line">2974</span><br><span class="line">2975</span><br><span class="line">2976</span><br><span class="line">2977</span><br><span class="line">2978</span><br><span class="line">2979</span><br><span class="line">2980</span><br><span class="line">2981</span><br><span class="line">2982</span><br><span class="line">2983</span><br><span class="line">2984</span><br><span class="line">2985</span><br><span class="line">2986</span><br><span class="line">2987</span><br><span class="line">2988</span><br><span class="line">2989</span><br><span class="line">2990</span><br><span class="line">2991</span><br><span class="line">2992</span><br><span class="line">2993</span><br><span class="line">2994</span><br><span class="line">2995</span><br><span class="line">2996</span><br><span class="line">2997</span><br><span class="line">2998</span><br><span class="line">2999</span><br><span class="line">3000</span><br><span class="line">3001</span><br><span class="line">3002</span><br><span class="line">3003</span><br><span class="line">3004</span><br><span class="line">3005</span><br><span class="line">3006</span><br><span class="line">3007</span><br><span class="line">3008</span><br><span class="line">3009</span><br><span class="line">3010</span><br><span class="line">3011</span><br><span class="line">3012</span><br><span class="line">3013</span><br><span class="line">3014</span><br><span class="line">3015</span><br><span class="line">3016</span><br><span class="line">3017</span><br><span class="line">3018</span><br><span class="line">3019</span><br><span class="line">3020</span><br><span class="line">3021</span><br><span class="line">3022</span><br><span class="line">3023</span><br><span class="line">3024</span><br><span class="line">3025</span><br><span class="line">3026</span><br><span class="line">3027</span><br><span class="line">3028</span><br><span class="line">3029</span><br><span class="line">3030</span><br><span class="line">3031</span><br><span class="line">3032</span><br><span class="line">3033</span><br><span class="line">3034</span><br><span class="line">3035</span><br><span class="line">3036</span><br><span class="line">3037</span><br><span class="line">3038</span><br><span class="line">3039</span><br><span class="line">3040</span><br><span class="line">3041</span><br><span class="line">3042</span><br><span class="line">3043</span><br><span class="line">3044</span><br><span class="line">3045</span><br><span class="line">3046</span><br><span class="line">3047</span><br><span class="line">3048</span><br><span class="line">3049</span><br><span class="line">3050</span><br><span class="line">3051</span><br><span class="line">3052</span><br><span class="line">3053</span><br><span class="line">3054</span><br><span class="line">3055</span><br><span class="line">3056</span><br><span class="line">3057</span><br><span class="line">3058</span><br><span class="line">3059</span><br><span class="line">3060</span><br><span class="line">3061</span><br><span class="line">3062</span><br><span class="line">3063</span><br><span class="line">3064</span><br><span class="line">3065</span><br><span class="line">3066</span><br><span class="line">3067</span><br><span class="line">3068</span><br><span class="line">3069</span><br><span class="line">3070</span><br><span class="line">3071</span><br><span class="line">3072</span><br><span class="line">3073</span><br><span class="line">3074</span><br><span class="line">3075</span><br><span class="line">3076</span><br><span class="line">3077</span><br><span class="line">3078</span><br><span class="line">3079</span><br><span class="line">3080</span><br><span class="line">3081</span><br><span class="line">3082</span><br><span class="line">3083</span><br><span class="line">3084</span><br><span class="line">3085</span><br><span class="line">3086</span><br><span class="line">3087</span><br><span class="line">3088</span><br><span class="line">3089</span><br><span class="line">3090</span><br><span class="line">3091</span><br><span class="line">3092</span><br><span class="line">3093</span><br><span class="line">3094</span><br><span class="line">3095</span><br><span class="line">3096</span><br><span class="line">3097</span><br><span class="line">3098</span><br><span class="line">3099</span><br><span class="line">3100</span><br><span class="line">3101</span><br><span class="line">3102</span><br><span class="line">3103</span><br><span class="line">3104</span><br><span class="line">3105</span><br><span class="line">3106</span><br><span class="line">3107</span><br><span class="line">3108</span><br><span class="line">3109</span><br><span class="line">3110</span><br><span class="line">3111</span><br><span class="line">3112</span><br><span class="line">3113</span><br><span class="line">3114</span><br><span class="line">3115</span><br><span class="line">3116</span><br><span class="line">3117</span><br><span class="line">3118</span><br><span class="line">3119</span><br><span class="line">3120</span><br><span class="line">3121</span><br><span class="line">3122</span><br><span class="line">3123</span><br><span class="line">3124</span><br><span class="line">3125</span><br><span class="line">3126</span><br><span class="line">3127</span><br><span class="line">3128</span><br><span class="line">3129</span><br><span class="line">3130</span><br><span class="line">3131</span><br><span class="line">3132</span><br><span class="line">3133</span><br><span class="line">3134</span><br><span class="line">3135</span><br><span class="line">3136</span><br><span class="line">3137</span><br><span class="line">3138</span><br><span class="line">3139</span><br><span class="line">3140</span><br><span class="line">3141</span><br><span class="line">3142</span><br><span class="line">3143</span><br><span class="line">3144</span><br><span class="line">3145</span><br><span class="line">3146</span><br><span class="line">3147</span><br><span class="line">3148</span><br><span class="line">3149</span><br><span class="line">3150</span><br><span class="line">3151</span><br><span class="line">3152</span><br><span class="line">3153</span><br><span class="line">3154</span><br><span class="line">3155</span><br><span class="line">3156</span><br><span class="line">3157</span><br><span class="line">3158</span><br><span class="line">3159</span><br><span class="line">3160</span><br><span class="line">3161</span><br><span class="line">3162</span><br><span class="line">3163</span><br><span class="line">3164</span><br><span class="line">3165</span><br><span class="line">3166</span><br><span class="line">3167</span><br><span class="line">3168</span><br><span class="line">3169</span><br><span class="line">3170</span><br><span class="line">3171</span><br><span class="line">3172</span><br><span class="line">3173</span><br><span class="line">3174</span><br><span class="line">3175</span><br><span class="line">3176</span><br><span class="line">3177</span><br><span class="line">3178</span><br><span class="line">3179</span><br><span class="line">3180</span><br><span class="line">3181</span><br><span class="line">3182</span><br><span class="line">3183</span><br><span class="line">3184</span><br><span class="line">3185</span><br><span class="line">3186</span><br><span class="line">3187</span><br><span class="line">3188</span><br><span class="line">3189</span><br><span class="line">3190</span><br><span class="line">3191</span><br><span class="line">3192</span><br><span class="line">3193</span><br><span class="line">3194</span><br><span class="line">3195</span><br><span class="line">3196</span><br><span class="line">3197</span><br><span class="line">3198</span><br><span class="line">3199</span><br><span class="line">3200</span><br><span class="line">3201</span><br><span class="line">3202</span><br><span class="line">3203</span><br><span class="line">3204</span><br><span class="line">3205</span><br><span class="line">3206</span><br><span class="line">3207</span><br><span class="line">3208</span><br><span class="line">3209</span><br><span class="line">3210</span><br><span class="line">3211</span><br><span class="line">3212</span><br><span class="line">3213</span><br><span class="line">3214</span><br><span class="line">3215</span><br><span class="line">3216</span><br><span class="line">3217</span><br><span class="line">3218</span><br><span class="line">3219</span><br><span class="line">3220</span><br><span class="line">3221</span><br><span class="line">3222</span><br><span class="line">3223</span><br><span class="line">3224</span><br><span class="line">3225</span><br><span class="line">3226</span><br><span class="line">3227</span><br><span class="line">3228</span><br><span class="line">3229</span><br><span class="line">3230</span><br><span class="line">3231</span><br><span class="line">3232</span><br><span class="line">3233</span><br><span class="line">3234</span><br><span class="line">3235</span><br><span class="line">3236</span><br><span class="line">3237</span><br><span class="line">3238</span><br><span class="line">3239</span><br><span class="line">3240</span><br><span class="line">3241</span><br><span class="line">3242</span><br><span class="line">3243</span><br><span class="line">3244</span><br><span class="line">3245</span><br><span class="line">3246</span><br><span class="line">3247</span><br><span class="line">3248</span><br><span class="line">3249</span><br><span class="line">3250</span><br><span class="line">3251</span><br><span class="line">3252</span><br><span class="line">3253</span><br><span class="line">3254</span><br><span class="line">3255</span><br><span class="line">3256</span><br><span class="line">3257</span><br><span class="line">3258</span><br><span class="line">3259</span><br><span class="line">3260</span><br><span class="line">3261</span><br><span class="line">3262</span><br><span class="line">3263</span><br><span class="line">3264</span><br><span class="line">3265</span><br><span class="line">3266</span><br><span class="line">3267</span><br><span class="line">3268</span><br><span class="line">3269</span><br><span class="line">3270</span><br><span class="line">3271</span><br><span class="line">3272</span><br><span class="line">3273</span><br><span class="line">3274</span><br><span class="line">3275</span><br><span class="line">3276</span><br><span class="line">3277</span><br><span class="line">3278</span><br><span class="line">3279</span><br><span class="line">3280</span><br><span class="line">3281</span><br><span class="line">3282</span><br><span class="line">3283</span><br><span class="line">3284</span><br><span class="line">3285</span><br><span class="line">3286</span><br><span class="line">3287</span><br><span class="line">3288</span><br><span class="line">3289</span><br><span class="line">3290</span><br><span class="line">3291</span><br><span class="line">3292</span><br><span class="line">3293</span><br><span class="line">3294</span><br><span class="line">3295</span><br><span class="line">3296</span><br><span class="line">3297</span><br><span class="line">3298</span><br><span class="line">3299</span><br><span class="line">3300</span><br><span class="line">3301</span><br><span class="line">3302</span><br><span class="line">3303</span><br><span class="line">3304</span><br><span class="line">3305</span><br><span class="line">3306</span><br><span class="line">3307</span><br><span class="line">3308</span><br><span class="line">3309</span><br><span class="line">3310</span><br><span class="line">3311</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">create</span> <span class="keyword">or</span> <span class="keyword">replace</span> <span class="keyword">PACKAGE</span> <span class="keyword">BODY</span> q$error_manager</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">| This program is a part of the Quest Error Manager for Oracle.</span></span><br><span class="line"><span class="comment">| This product is freeware and is not supported by Quest.</span></span><br><span class="line"><span class="comment">|</span></span><br><span class="line"><span class="comment">| www.quest.com</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">?2008 Quest Software, Inc.</span></span><br><span class="line"><span class="comment">ALL RIGHTS RESERVED.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Redistribution and use of the Quest Error Manager for Oracle software in source and binary forms,</span></span><br><span class="line"><span class="comment">with or without modification, are permitted provided that the following conditions are met:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">1.  Redistributions of source code must retain (i) the following copyright notice: "?008 Quest Software, Inc.</span></span><br><span class="line"><span class="comment">All rights reserved," (ii) this list of conditions, and (iii) the disclaimer below.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">2.  Redistributions in binary form must reproduce (i) the following copyright notice:</span></span><br><span class="line"><span class="comment">"?008 Quest Software, Inc. All rights reserved," (ii) this list of conditions, and (iii)</span></span><br><span class="line"><span class="comment">the disclaimer below, in the documentation and/or other materials provided with the distribution.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">3.  All advertising materials mentioning features or use of the Quest Error Manager</span></span><br><span class="line"><span class="comment">for Oracle software must display the following acknowledgement:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">This product includes software developed by Quest Software, Inc. and its contributors.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">4.  Neither the name of Quest Software, Inc. nor the name its affiliates, subsidiaries</span></span><br><span class="line"><span class="comment">or contributors may be used to endorse or promote products derived from the Quest Error</span></span><br><span class="line"><span class="comment">Manager for Oracle software without specific prior written permission from Quest Software, Inc.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">Disclaimer:</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">THIS SOFTWARE IS PROVIDED BY QUEST SOFTWARE, INC. AND ITS CONTRIBUTORS ``AS IS''</span></span><br><span class="line"><span class="comment">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,</span></span><br><span class="line"><span class="comment">THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,</span></span><br><span class="line"><span class="comment">AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL QUEST SOFTWARE OR ITS</span></span><br><span class="line"><span class="comment">CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,</span></span><br><span class="line"><span class="comment">OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span></span><br><span class="line"><span class="comment">GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span></span><br><span class="line"><span class="comment">HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span></span><br><span class="line"><span class="comment">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE</span></span><br><span class="line"><span class="comment">QUEST ERROR MANAGER SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"><span class="keyword">IS</span></span><br><span class="line">    c_default_error_code   <span class="keyword">CONSTANT</span> PLS_INTEGER := <span class="number">-20000</span>;</span><br><span class="line">    g_clipboard                     maxvarchar2_t;</span><br><span class="line">    g_clipboard_is_full             BOOLEAN DEFAULT FALSE;</span><br><span class="line">    <span class="comment">--</span></span><br><span class="line">    c_trunc_warning                 VARCHAR2 (100)</span><br><span class="line">        := '*** WARNING: Information truncated! ';</span><br><span class="line">    c_warning_len                   PLS_INTEGER := LENGTH (c_warning);</span><br><span class="line">    <span class="comment">--</span></span><br><span class="line">    <span class="comment">-- trace variables</span></span><br><span class="line">    g_trace_enabled                 BOOLEAN := FALSE;</span><br><span class="line">    g_error_trace_enabled           BOOLEAN := TRUE;</span><br><span class="line">    g_context_like                  q$log.context%TYPE := NULL;</span><br><span class="line">    g_include_timestamp             BOOLEAN := FALSE;</span><br><span class="line">    g_multiple_contexts             BOOLEAN := FALSE;</span><br><span class="line">    g_context_list                  DBMS_SQL.varchar2s;</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    Flag to indicate that the error has already been registered</span></span><br><span class="line"><span class="comment">    and raised within QD, so just propagate it on up the call stack.</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    g_error_instance_raised         q$error_instance.id%TYPE DEFAULT NULL;</span><br><span class="line">    <span class="comment">-- system settings</span></span><br><span class="line">    g_grabbed_settings              error_info_rt;</span><br><span class="line">    <span class="comment">/* 1.4.0 flag to register is we want to append the remaining context to text */</span></span><br><span class="line">    g_add_remaining_context_msg     BOOLEAN := TRUE;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Global contexts</span></span><br><span class="line">    TYPE gcontext_rt IS RECORD</span><br><span class="line">    (</span><br><span class="line">        name    q$error_context.name%TYPE</span><br><span class="line">       ,VALUE   q$error_context.VALUE%TYPE</span><br><span class="line">    );</span><br><span class="line"></span><br><span class="line">    TYPE gcontext_tt IS TABLE OF gcontext_rt</span><br><span class="line">                            INDEX BY BINARY_INTEGER;</span><br><span class="line"></span><br><span class="line">    g_gcontexts                     gcontext_tt;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- current program</span></span><br><span class="line">    TYPE runtime_rt IS RECORD</span><br><span class="line">    (</span><br><span class="line">        package_name   all_objects.object_name%TYPE</span><br><span class="line">       ,program_name   all_objects.object_name%TYPE</span><br><span class="line">    );</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.2.14 No longer used</span></span><br><span class="line"><span class="comment">    g_runtime runtime_rt; -- "current" running program</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- collection of record</span></span><br><span class="line">    TYPE runtime_nat IS TABLE OF runtime_rt;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- runtime stack implemented as a dense nested table.</span></span><br><span class="line">    <span class="comment">-- starts with element 1 and grows upward.</span></span><br><span class="line">    g_runtime_nat                   runtime_nat := runtime_nat ();</span><br><span class="line">    <span class="comment">-- trace target</span></span><br><span class="line">    c_screen               CONSTANT INTEGER := 0;</span><br><span class="line">    c_table                CONSTANT INTEGER := 1;</span><br><span class="line">    <span class="comment">--1.4.1   c_file                 CONSTANT INTEGER := 2;</span></span><br><span class="line">    g_target                        INTEGER := c_table;</span><br><span class="line"></span><br><span class="line">    TYPE trace_file_info_rt IS RECORD</span><br><span class="line">    (</span><br><span class="line">        dir             maxvarchar2_t</span><br><span class="line">       ,filename        maxvarchar2_t</span><br><span class="line">       ,lines_written   PLS_INTEGER</span><br><span class="line">    );</span><br><span class="line"></span><br><span class="line">    g_file_info                     trace_file_info_rt;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Every hundred lines written, close and reopen.</span></span><br><span class="line">    <span class="comment">--1.4.1   c_close_threshold      CONSTANT PLS_INTEGER := 100;</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">/* V1.2.11 show/hide setting */</span></span><br><span class="line">    TYPE show_oracle_rt IS RECORD</span><br><span class="line">    (</span><br><span class="line">        <span class="keyword">show</span>        <span class="built_in">BOOLEAN</span> <span class="keyword">DEFAULT</span> <span class="literal">FALSE</span></span><br><span class="line">       ,revert      <span class="built_in">BOOLEAN</span> <span class="keyword">DEFAULT</span> <span class="literal">FALSE</span></span><br><span class="line">       ,revert_to   <span class="built_in">BOOLEAN</span></span><br><span class="line">    );</span><br><span class="line"></span><br><span class="line">    g_show_oracle                   show_oracle_rt;</span><br><span class="line">    <span class="comment">/* Option on how error is raised. */</span></span><br><span class="line">    c_with_handle          CONSTANT PLS_INTEGER := -98;</span><br><span class="line">    c_with_message         CONSTANT PLS_INTEGER := +75;</span><br><span class="line">    g_raise_with                    PLS_INTEGER := c_with_handle;</span><br><span class="line"></span><br><span class="line">    g_discard_error_state           BOOLEAN := FALSE;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    1.2.12 Provide switch to force display of "real" error in the error message,</span></span><br><span class="line"><span class="comment">     rather than simply showing the error handle. This is needed when</span></span><br><span class="line"><span class="comment">     user is running tests via the API and is not retrieving errors via</span></span><br><span class="line"><span class="comment">     get_error_info.</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    PROCEDURE raise_with_message</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_raise_with := c_with_message;</span><br><span class="line">    <span class="keyword">END</span> raise_with_message;</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_with_handle</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_raise_with := c_with_handle;</span><br><span class="line">    <span class="keyword">END</span> raise_with_handle;</span><br><span class="line"></span><br><span class="line">    FUNCTION raising_with_message</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_raise_with = c_with_message;</span><br><span class="line">    <span class="keyword">END</span> raising_with_message;</span><br><span class="line"></span><br><span class="line">    FUNCTION raising_with_handle</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_raise_with = c_with_handle;</span><br><span class="line">    <span class="keyword">END</span> raising_with_handle;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* END 1.2.12 changes */</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Private routines/handy utilities</span></span><br><span class="line">    FUNCTION error_backtrace (prefix_with_error_in IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        l_errortrace   maxvarchar2_t := DBMS_UTILITY.format_error_stack;</span><br><span class="line">        l_backtrace    maxvarchar2_t;</span><br><span class="line">        l_return       maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">EXECUTE</span> <span class="keyword">IMMEDIATE</span> <span class="string">'BEGIN :val := DBMS_UTILITY.format_error_backtrace; END;'</span></span><br><span class="line">            <span class="keyword">USING</span> <span class="keyword">OUT</span> l_backtrace;</span><br><span class="line"></span><br><span class="line">        l_return :=</span><br><span class="line">            CASE</span><br><span class="line">                WHEN prefix_with_error_in</span><br><span class="line">                THEN</span><br><span class="line">                    l_errortrace || CHR (10) || CHR (10) || l_backtrace</span><br><span class="line">                ELSE</span><br><span class="line">                    l_backtrace</span><br><span class="line">            <span class="keyword">END</span>;</span><br><span class="line">        RETURN l_return;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            RETURN l_errortrace;</span><br><span class="line">    <span class="keyword">END</span> error_backtrace;</span><br><span class="line"></span><br><span class="line">    FUNCTION oracle_app_error (code_in IN PLS_INTEGER)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> code_in <span class="keyword">BETWEEN</span> <span class="number">-20999</span> <span class="keyword">AND</span> <span class="number">-20000</span>;</span><br><span class="line">    <span class="keyword">END</span> oracle_app_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE validate_oracle_error (code_in        IN     PLS_INTEGER</span><br><span class="line">                                    ,message_out       OUT VARCHAR2</span><br><span class="line">                                    ,is_valid_out      OUT BOOLEAN)</span><br><span class="line">    IS</span><br><span class="line">        l_message   maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">/* Take care of special case... */</span></span><br><span class="line">        <span class="keyword">IF</span> code_in <span class="keyword">IN</span> (<span class="number">100</span>, <span class="number">-1403</span>)</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            is_valid_out := <span class="literal">TRUE</span>;</span><br><span class="line">        ELSE</span><br><span class="line">            l_message := SQLERRM (code_in);</span><br><span class="line"></span><br><span class="line">            <span class="comment">-- If SQLERRM does not find an entry, it return a string like one of these:</span></span><br><span class="line">            <span class="comment">-- If the number is negative...</span></span><br><span class="line">            <span class="comment">-- ORA-NNNNN: Message NNNN not found; product=RDBMS; facility=ORA</span></span><br><span class="line">            <span class="comment">-- If the number is positive...</span></span><br><span class="line">            <span class="comment">--  -13000: non-ORACLE exception</span></span><br><span class="line">            <span class="comment">-- If the positive number is too big, we get numeric overflow.</span></span><br><span class="line">            IF l_message LIKE 'ORA-_____: Message%not found;%'</span><br><span class="line">               OR l_message LIKE '%: non-ORACLE exception%'</span><br><span class="line">            THEN</span><br><span class="line">                message_out := NULL;</span><br><span class="line">                is_valid_out := FALSE;</span><br><span class="line">            ELSE</span><br><span class="line">                message_out := l_message;</span><br><span class="line">                is_valid_out := TRUE;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            <span class="comment">--numeric overflow</span></span><br><span class="line">            IF SQLCODE = -1426</span><br><span class="line">            THEN</span><br><span class="line">                message_out := NULL;</span><br><span class="line">                is_valid_out := FALSE;</span><br><span class="line">            ELSE</span><br><span class="line">                RAISE;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> validate_oracle_error;</span><br><span class="line"></span><br><span class="line">    FUNCTION is_valid_oracle_error (code_in IN PLS_INTEGER)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">        l_message   maxvarchar2_t;</span><br><span class="line">        retval      BOOLEAN;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        validate_oracle_error (code_in, l_message, retval);</span><br><span class="line">        RETURN retval;</span><br><span class="line">    <span class="keyword">END</span> is_valid_oracle_error;</span><br><span class="line"></span><br><span class="line">    FUNCTION sqlcode_name (error_code_in IN PLS_INTEGER)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        l_return   maxvarchar2_t;   <span class="comment">/* 1.2.16 all_objects.object_name%TYPE; */</span></span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        l_return :=</span><br><span class="line">            <span class="keyword">CASE</span> error_code_in</span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6511</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'CURSOR_ALREADY_OPEN'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-0001</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'DUP_VAL_ON_INDEX'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-0051</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'TIMEOUT_ON_RESOURCE'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1001</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'INVALID_CURSOR'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1012</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'NOT_LOGGED_ON'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1017</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'LOGIN_DENIED'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">100</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'NO_DATA_FOUND'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1476</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'ZERO_DIVIDE'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1722</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'INVALID_NUMBER'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1422</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'TOO_MANY_ROWS'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6500</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'STORAGE_ERROR'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6501</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'PROGRAM_ERROR'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6502</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'VALUE_ERROR'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6530</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'ACCESS_INTO_NULL'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6531</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'COLLECTION_IS_NULL '</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6532</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'SUBSCRIPT_OUTSIDE_LIMIT'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6533</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'SUBSCRIPT_BEYOND_COUNT '</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-650</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'ROWTYPE_MISMATCH'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1410</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'SYS_INVALID_ROWID'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-30625</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'SELF_IS_NULL'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6592</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'CASE_NOT_FOUND'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-1725</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'USERENV_COMMITSCN_ERROR'</span></span><br><span class="line">                <span class="keyword">WHEN</span> <span class="number">-6548</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    <span class="string">'NO_DATA_NEEDED'</span></span><br><span class="line">                <span class="keyword">ELSE</span></span><br><span class="line">                    <span class="keyword">UPPER</span> (</span><br><span class="line">                        <span class="keyword">SUBSTR</span> (SQLERRM (error_code_in)</span><br><span class="line">                               ,<span class="keyword">INSTR</span> (SQLERRM (error_code_in), <span class="string">':'</span>) + <span class="number">2</span>))</span><br><span class="line">            <span class="keyword">END</span>;</span><br><span class="line">        RETURN l_return;</span><br><span class="line">    <span class="keyword">END</span> sqlcode_name;</span><br><span class="line"></span><br><span class="line">    FUNCTION sqlcode_text (error_code_in IN PLS_INTEGER)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> error_code_in <span class="keyword">IN</span> (<span class="number">100</span>, <span class="number">-1403</span>)</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">RETURN</span> <span class="string">'No data found'</span>;</span><br><span class="line">        ELSE</span><br><span class="line">            RETURN SQLERRM (error_code_in);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> sqlcode_text;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- MOve from q$error_qp to remove dependency on package.</span></span><br><span class="line">    FUNCTION q$error_qp_onerow (id_in IN q$error.id%TYPE)</span><br><span class="line">        RETURN q$error%ROWTYPE</span><br><span class="line">    IS</span><br><span class="line">        CURSOR onerow_cur</span><br><span class="line">        IS</span><br><span class="line">            <span class="keyword">SELECT</span> *</span><br><span class="line">              <span class="keyword">FROM</span> q$<span class="keyword">error</span></span><br><span class="line">             <span class="keyword">WHERE</span> <span class="keyword">id</span> = id_in;</span><br><span class="line"></span><br><span class="line">        onerow_rec   q$error%ROWTYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">OPEN</span> onerow_cur;</span><br><span class="line"></span><br><span class="line">        FETCH onerow_cur INTO onerow_rec;</span><br><span class="line"></span><br><span class="line">        CLOSE onerow_cur;</span><br><span class="line"></span><br><span class="line">        RETURN onerow_rec;</span><br><span class="line">    <span class="keyword">END</span> q$error_qp_onerow;</span><br><span class="line"></span><br><span class="line">    FUNCTION q$error_instance_qp_onerow (id_in IN q$error_instance.id%TYPE)</span><br><span class="line">        RETURN q$error_instance%ROWTYPE</span><br><span class="line">    IS</span><br><span class="line">        CURSOR onerow_cur</span><br><span class="line">        IS</span><br><span class="line">            <span class="keyword">SELECT</span> *</span><br><span class="line">              <span class="keyword">FROM</span> q$error_instance</span><br><span class="line">             <span class="keyword">WHERE</span> <span class="keyword">id</span> = id_in;</span><br><span class="line"></span><br><span class="line">        onerow_rec   q$error_instance%ROWTYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">OPEN</span> onerow_cur;</span><br><span class="line"></span><br><span class="line">        FETCH onerow_cur INTO onerow_rec;</span><br><span class="line"></span><br><span class="line">        CLOSE onerow_cur;</span><br><span class="line"></span><br><span class="line">        RETURN onerow_rec;</span><br><span class="line">    <span class="keyword">END</span> q$error_instance_qp_onerow;</span><br><span class="line"></span><br><span class="line">    PROCEDURE mark_q$error_raised (id_in IN q$error_instance.id%TYPE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">/* 1.2.17 Do not maintain state if user has requested this non-default</span></span><br><span class="line"><span class="comment">          behavior. That is, immediately mark it as handled. */</span></span><br><span class="line">        <span class="keyword">IF</span> error_state_discarded ()</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            mark_q$error_handled ();</span><br><span class="line">        ELSE</span><br><span class="line">            g_error_instance_raised := id_in;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> mark_q$error_raised;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Reset when get_error_info is called.</span></span><br><span class="line">    PROCEDURE mark_q$error_handled</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_error_instance_raised := <span class="literal">NULL</span>;</span><br><span class="line">        clear_gcontexts;</span><br><span class="line">    <span class="keyword">END</span> mark_q$error_handled;</span><br><span class="line"></span><br><span class="line">    FUNCTION q$error_instance_id_raised</span><br><span class="line">        RETURN q$error_instance.id%TYPE</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_error_instance_raised;</span><br><span class="line">    <span class="keyword">END</span> q$error_instance_id_raised;</span><br><span class="line"></span><br><span class="line">    FUNCTION q$error_raised</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> <span class="comment">/* 1.4.0 Do not directly reference variables</span></span><br><span class="line"><span class="comment">         g_error_instance_raised */</span></span><br><span class="line">              q$error_instance_id_raised () <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span>;</span><br><span class="line">    <span class="keyword">END</span> q$error_raised;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- returns the program name at the "top" of the runtime stack</span></span><br><span class="line">    FUNCTION top_program_name</span><br><span class="line">        RETURN all_objects.object_name%TYPE</span><br><span class="line">    IS</span><br><span class="line">        v_program_name   all_objects.object_name%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> (g_runtime_nat.COUNT &gt; <span class="number">0</span>)</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            v_program_name := g_runtime_nat (g_runtime_nat.LAST).program_name;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN (v_program_name);</span><br><span class="line">    <span class="keyword">END</span> top_program_name;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- PBA 20040518</span></span><br><span class="line">    FUNCTION top_package_name</span><br><span class="line">        RETURN all_objects.object_name%TYPE</span><br><span class="line">    IS</span><br><span class="line">        v_package_name   all_objects.object_name%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> (g_runtime_nat.COUNT &gt; <span class="number">0</span>)</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            v_package_name := g_runtime_nat (g_runtime_nat.LAST).program_name;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN (v_package_name);</span><br><span class="line">    <span class="keyword">END</span> top_package_name;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- PBA 20040518</span></span><br><span class="line">    FUNCTION top_packprog_name</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> top_package_name || <span class="string">'.'</span> || top_program_name;</span><br><span class="line">    <span class="keyword">END</span> top_packprog_name;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- returns the current runtime context at the "top" of the runtime stack</span></span><br><span class="line">    FUNCTION top_runtime</span><br><span class="line">        RETURN runtime_rt</span><br><span class="line">    IS</span><br><span class="line">        v_runtime   runtime_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> (g_runtime_nat.COUNT &gt; <span class="number">0</span>)</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            v_runtime := g_runtime_nat (g_runtime_nat.LAST);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN (v_runtime);</span><br><span class="line">    <span class="keyword">END</span> top_runtime;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- convert Boolean value to String</span></span><br><span class="line">    FUNCTION strval (val IN BOOLEAN)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> val</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">RETURN</span> (<span class="string">'TRUE'</span>);</span><br><span class="line">        ELSIF NOT val</span><br><span class="line">        THEN</span><br><span class="line">            RETURN ('FALSE');</span><br><span class="line">        ELSE</span><br><span class="line">            RETURN ('NULL');</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> strval;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- public routines (exposed in the package header)</span></span><br><span class="line">    <span class="comment">-- -------------------------------------</span></span><br><span class="line">    <span class="comment">-- Tracing and DBMS_OUTPUT encapsulation</span></span><br><span class="line">    <span class="comment">-- -------------------------------------</span></span><br><span class="line">    <span class="comment">-- Tracing and DBMS_OUTPUT encapsulation</span></span><br><span class="line">    <span class="comment">-- switches output to the console</span></span><br><span class="line">    <span class="comment">-- <span class="doctag">NOTE:</span> default is to Table</span></span><br><span class="line">    PROCEDURE toscreen</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_target := c_screen;</span><br><span class="line">    <span class="keyword">END</span> toscreen;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- switches output to the q$log table</span></span><br><span class="line">    <span class="comment">-- <span class="doctag">NOTE:</span> this is the default destination</span></span><br><span class="line">    PROCEDURE totable</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_target := c_table;</span><br><span class="line">    <span class="keyword">END</span> totable;</span><br><span class="line"></span><br><span class="line">    PROCEDURE totable (purge_in IN BOOLEAN)</span><br><span class="line">    IS</span><br><span class="line">        <span class="keyword">PRAGMA</span> AUTONOMOUS_TRANSACTION;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        totable ();</span><br><span class="line"></span><br><span class="line">        IF purge_in</span><br><span class="line">        THEN</span><br><span class="line">            <span class="keyword">DELETE</span> <span class="keyword">FROM</span> q$<span class="keyword">log</span>;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">COMMIT</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> totable;</span><br><span class="line"></span><br><span class="line">    PROCEDURE tofile (dir_in         IN VARCHAR2</span><br><span class="line">                     ,file_in        IN VARCHAR2</span><br><span class="line">                     ,overwrite_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_file_info.dir := dir_in;</span><br><span class="line">        g_file_info.filename := file_in;</span><br><span class="line">        g_file_info.lines_written := 0;</span><br><span class="line">        <span class="comment">/*</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">        Write to file now occurs in front end when tracing is terminated</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">        g_file_info.file_handle :=</span></span><br><span class="line"><span class="comment">         utx_file.fopen (dir_in</span></span><br><span class="line"><span class="comment">         , file_in</span></span><br><span class="line"><span class="comment">         , CASE</span></span><br><span class="line"><span class="comment">         WHEN overwrite_in</span></span><br><span class="line"><span class="comment">         THEN 'W'</span></span><br><span class="line"><span class="comment">         ELSE 'A'</span></span><br><span class="line"><span class="comment">         END</span></span><br><span class="line"><span class="comment">         , max_linesize =&gt; 32767</span></span><br><span class="line"><span class="comment">          );*/</span></span><br><span class="line"></span><br><span class="line">        <span class="comment">/*</span></span><br><span class="line"><span class="comment">        We still write to the table, and then dump to file later.</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        g_target := c_table;</span><br><span class="line">    <span class="keyword">END</span> tofile;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- simple DBMS_OUTPUT handling of 255 char limit</span></span><br><span class="line">    <span class="comment">-- looks for a newline, or chops to fit given length</span></span><br><span class="line">    PROCEDURE pl (string_in IN VARCHAR2, length_in IN PLS_INTEGER := 80)</span><br><span class="line">    IS</span><br><span class="line">        v_len     PLS_INTEGER := LEAST (length_in, 255);</span><br><span class="line">        v_len2    PLS_INTEGER;</span><br><span class="line">        v_chr10   PLS_INTEGER;</span><br><span class="line">        v_str     VARCHAR2 (2000);</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> <span class="keyword">LENGTH</span> (string_in) &gt; v_len</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            v_chr10 := <span class="keyword">INSTR</span> (string_in, <span class="keyword">CHR</span> (<span class="number">10</span>));</span><br><span class="line"></span><br><span class="line">            IF v_chr10 &gt; 0 AND v_len &gt;= v_chr10</span><br><span class="line">            THEN</span><br><span class="line">                v_len := v_chr10 - 1;</span><br><span class="line">                v_len2 := v_chr10 + 1;</span><br><span class="line">            ELSE</span><br><span class="line">                v_len2 := v_len + 1;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            v_str := SUBSTR (string_in, 1, v_len);</span><br><span class="line">            DBMS_OUTPUT.put_line (v_str);</span><br><span class="line">            pl (string_in   =&gt; SUBSTR (string_in, v_len2)</span><br><span class="line">               ,length_in   =&gt; length_in);</span><br><span class="line">        ELSE</span><br><span class="line">            DBMS_OUTPUT.put_line (string_in);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        <span class="comment">/* 1.3.1 Volker Bartuseck fix */</span></span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            DBMS_OUTPUT.enable (1000000);</span><br><span class="line"></span><br><span class="line">            IF v_str IS NULL</span><br><span class="line">            THEN</span><br><span class="line">                DBMS_OUTPUT.put_line (string_in);</span><br><span class="line">            ELSE</span><br><span class="line">                DBMS_OUTPUT.put_line (v_str);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> pl;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- converts the given boolean value to string,</span></span><br><span class="line">    <span class="comment">-- then writes it out as above</span></span><br><span class="line">    PROCEDURE pl (val IN BOOLEAN)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        pl (strval (val));</span><br><span class="line">    <span class="keyword">END</span> pl;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- as above but concatenates str with the string value of bool</span></span><br><span class="line">    <span class="comment">-- e.g., 'cursor%found TRUE'</span></span><br><span class="line">    PROCEDURE pl (str IN VARCHAR2, bool IN BOOLEAN, len IN PLS_INTEGER := 80)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        pl (string_in =&gt; <span class="keyword">str</span> || <span class="string">' '</span> || strval (bool), length_in =&gt; <span class="keyword">len</span>);</span><br><span class="line">    <span class="keyword">END</span> pl;</span><br><span class="line"></span><br><span class="line">    PROCEDURE pl (clob_in IN CLOB, length_in IN PLS_INTEGER := 80)</span><br><span class="line">    IS</span><br><span class="line">        buffer     VARCHAR2 (255);</span><br><span class="line">        amount     BINARY_INTEGER := GREATEST (length_in, 255);</span><br><span class="line">        position   INTEGER := 1;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">LOOP</span></span><br><span class="line">            DBMS_LOB.read (clob_in</span><br><span class="line">                          ,amount</span><br><span class="line">                          ,<span class="keyword">position</span></span><br><span class="line">                          ,buffer);</span><br><span class="line">            <span class="comment">/* Display the buffer contents using the string overloading */</span></span><br><span class="line">            pl (buffer);</span><br><span class="line">            position := position + amount;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN NO_DATA_FOUND OR VALUE_ERROR</span><br><span class="line">        THEN</span><br><span class="line">            pl ('** End of CLOB data **');</span><br><span class="line">    <span class="keyword">END</span> pl;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    PROCEDURE set_error_trace (onoff_in IN BOOLEAN)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> onoff_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            error_trace_on;</span><br><span class="line">        ELSE</span><br><span class="line">            error_trace_off;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> set_error_trace;</span><br><span class="line"></span><br><span class="line">    PROCEDURE error_trace_on</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_error_trace_enabled := <span class="literal">TRUE</span>;</span><br><span class="line">    <span class="keyword">END</span> error_trace_on;</span><br><span class="line"></span><br><span class="line">    PROCEDURE error_trace_off</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_error_trace_enabled := <span class="literal">FALSE</span>;</span><br><span class="line">    <span class="keyword">END</span> error_trace_off;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_trace_enabled</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_error_trace_enabled;</span><br><span class="line">    <span class="keyword">END</span> error_trace_enabled;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*1.4.0 */</span></span><br><span class="line">    PROCEDURE add_remaining_context_msg_on</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_add_remaining_context_msg := <span class="literal">TRUE</span>;</span><br><span class="line">    <span class="keyword">END</span> add_remaining_context_msg_on;</span><br><span class="line"></span><br><span class="line">    PROCEDURE add_remaining_context_msg_off</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_add_remaining_context_msg := <span class="literal">FALSE</span>;</span><br><span class="line">    <span class="keyword">END</span> add_remaining_context_msg_off;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    PROCEDURE set_add_remaining_context_msg (onoff_in IN BOOLEAN)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> onoff_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            add_remaining_context_msg_on;</span><br><span class="line">        ELSE</span><br><span class="line">            add_remaining_context_msg_off;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> set_add_remaining_context_msg;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    FUNCTION add_remaining_context_enabled</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_add_remaining_context_msg;</span><br><span class="line">    <span class="keyword">END</span> add_remaining_context_enabled;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* end 1.4.0 */</span></span><br><span class="line">    FUNCTION string_to_list (string_in IN VARCHAR2, delim_in IN VARCHAR2)</span><br><span class="line">        RETURN DBMS_SQL.varchar2s</span><br><span class="line">    IS</span><br><span class="line">        c_end_of_list   CONSTANT PLS_INTEGER := -99;</span><br><span class="line">        l_item                   maxvarchar2_t;</span><br><span class="line">        l_startloc               PLS_INTEGER := 1;</span><br><span class="line">        items_out                DBMS_SQL.varchar2s;</span><br><span class="line"></span><br><span class="line">        PROCEDURE add_item (item_in IN VARCHAR2)</span><br><span class="line">        IS</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            <span class="keyword">IF</span> item_in = delim_in</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                <span class="comment">/* We don't put delimiters into the collection. */</span></span><br><span class="line">                <span class="literal">NULL</span>;</span><br><span class="line">            ELSE</span><br><span class="line">                items_out (items_out.COUNT + 1) := RTRIM (LTRIM (item_in));</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> add_item;</span><br><span class="line"></span><br><span class="line">        PROCEDURE get_next_item (string_in        IN     VARCHAR2</span><br><span class="line">                                ,startloc_inout   IN OUT PLS_INTEGER</span><br><span class="line">                                ,item_out            OUT VARCHAR2)</span><br><span class="line">        IS</span><br><span class="line">            l_loc   PLS_INTEGER;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            l_loc := <span class="keyword">INSTR</span> (string_in, delim_in, startloc_inout);</span><br><span class="line"></span><br><span class="line">            IF l_loc = startloc_inout                 <span class="comment">-- Previous item is NULL</span></span><br><span class="line">            THEN</span><br><span class="line">                item_out := NULL;</span><br><span class="line">            ELSIF l_loc = 0                     <span class="comment">-- Rest of string is last item</span></span><br><span class="line">            THEN</span><br><span class="line">                item_out := SUBSTR (string_in, startloc_inout);</span><br><span class="line">            ELSE</span><br><span class="line">                item_out :=</span><br><span class="line">                    SUBSTR (string_in</span><br><span class="line">                           ,startloc_inout</span><br><span class="line">                           ,l_loc - startloc_inout);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            IF l_loc = 0</span><br><span class="line">            THEN</span><br><span class="line">                startloc_inout := c_end_of_list;</span><br><span class="line">            ELSE</span><br><span class="line">                startloc_inout := l_loc + 1;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> get_next_item;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> string_in <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span> <span class="keyword">AND</span> delim_in <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">LOOP</span></span><br><span class="line">                get_next_item (string_in, l_startloc, l_item);</span><br><span class="line">                add_item (l_item);</span><br><span class="line">                EXIT WHEN l_startloc = c_end_of_list;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN items_out;</span><br><span class="line">    <span class="keyword">END</span> string_to_list;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Clears out the trace contents. Currently just deletes from q$log.</span></span><br><span class="line">    PROCEDURE clear_trace</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">EXECUTE</span> <span class="keyword">IMMEDIATE</span> <span class="string">'truncate table q$log'</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            NULL;</span><br><span class="line">    <span class="keyword">END</span> clear_trace;</span><br><span class="line"></span><br><span class="line">    PROCEDURE set_trace (onoff_in               IN BOOLEAN</span><br><span class="line">                        ,context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                        ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                        ,delimiter_in           IN VARCHAR2 DEFAULT ',')</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">-- Special commands....</span></span><br><span class="line">        <span class="keyword">IF</span> onoff_in <span class="keyword">AND</span> <span class="keyword">UPPER</span> (context_like_in) = <span class="string">'QCTO#TOTABLE'</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            totable (purge_in =&gt; <span class="literal">TRUE</span>);</span><br><span class="line">            g_trace_enabled := onoff_in;</span><br><span class="line">            g_context_like := '%';</span><br><span class="line">            q$error_manager.trace (</span><br><span class="line">                'set_trace to table via override with context "%"'</span><br><span class="line">               ,g_trace_enabled);</span><br><span class="line">            g_include_timestamp := include_timestamp_in;</span><br><span class="line">        ELSE</span><br><span class="line">            g_trace_enabled := onoff_in;</span><br><span class="line">            g_context_like := UPPER (NVL (context_like_in, '%'));</span><br><span class="line">            q$error_manager.trace (</span><br><span class="line">                'set_trace with context "' || g_context_like || '"'</span><br><span class="line">               ,g_trace_enabled);</span><br><span class="line">            g_include_timestamp := include_timestamp_in;</span><br><span class="line"></span><br><span class="line">            <span class="comment">/*</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">              Write to file now occurs in front end when tracing is terminated</span></span><br><span class="line"><span class="comment">              IF NOT g_trace_enabled AND g_target = c_file</span></span><br><span class="line"><span class="comment">              THEN</span></span><br><span class="line"><span class="comment">             utx_file.fclose (g_file_info.file_handle);</span></span><br><span class="line"><span class="comment">              END IF;*/</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">-- BM 1239 When turning off, set back to table, which is the default.</span></span><br><span class="line">            IF NOT g_trace_enabled</span><br><span class="line">            THEN</span><br><span class="line">                totable;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        g_multiple_contexts := INSTR (context_like_in, delimiter_in) &gt; 0;</span><br><span class="line"></span><br><span class="line">        IF g_multiple_contexts</span><br><span class="line">        THEN</span><br><span class="line">            g_context_list := string_to_list (context_like_in, delimiter_in);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> set_trace;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace_on (context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                       ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                       ,delimiter_in           IN VARCHAR2 DEFAULT ',')</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        set_trace (onoff_in               =&gt; <span class="literal">TRUE</span></span><br><span class="line">                  ,context_like_in        =&gt; context_like_in</span><br><span class="line">                  ,include_timestamp_in   =&gt; include_timestamp_in);</span><br><span class="line">    <span class="keyword">END</span> trace_on;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace_off (context_like_in        IN q$log.context%TYPE := NULL</span><br><span class="line">                        ,include_timestamp_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        set_trace (onoff_in               =&gt; <span class="literal">FALSE</span></span><br><span class="line">                  ,context_like_in        =&gt; context_like_in</span><br><span class="line">                  ,include_timestamp_in   =&gt; include_timestamp_in);</span><br><span class="line">    <span class="keyword">END</span> trace_off;</span><br><span class="line"></span><br><span class="line">    FUNCTION trace_enabled</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_trace_enabled;</span><br><span class="line">    <span class="keyword">END</span> trace_enabled;</span><br><span class="line"></span><br><span class="line">    FUNCTION context_matches (context_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">FOR</span> indx <span class="keyword">IN</span> <span class="number">1</span> .. g_context_list.COUNT</span><br><span class="line">        <span class="keyword">LOOP</span></span><br><span class="line">            <span class="keyword">IF</span> <span class="keyword">UPPER</span> (context_in) <span class="keyword">LIKE</span> <span class="keyword">UPPER</span> (g_context_list (indx))</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                <span class="keyword">RETURN</span> <span class="literal">TRUE</span>;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line"></span><br><span class="line">        RETURN FALSE;</span><br><span class="line">    <span class="keyword">END</span> context_matches;</span><br><span class="line"></span><br><span class="line">    FUNCTION trace_enabled (context_in IN q$log.context%TYPE)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">        l_return   BOOLEAN DEFAULT FALSE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> g_trace_enabled</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="comment">/* IF multiple contexts, then check for exact match. */</span></span><br><span class="line"></span><br><span class="line">            <span class="keyword">IF</span> g_multiple_contexts</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                l_return := context_matches (context_in);</span><br><span class="line">            <span class="comment">/* Use wildcarded comparision */</span></span><br><span class="line">            ELSE</span><br><span class="line">                l_return :=</span><br><span class="line">                    (g_context_like IS NULL</span><br><span class="line">                     OR UPPER (context_in) LIKE '%' || g_context_like || '%');</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN l_return;</span><br><span class="line">    <span class="keyword">END</span> trace_enabled;</span><br><span class="line"></span><br><span class="line">    FUNCTION full_log_string (context_in   IN VARCHAR2</span><br><span class="line">                             ,text_in      IN VARCHAR2</span><br><span class="line">                             ,level_in     IN PLS_INTEGER)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        <span class="comment">/*</span></span><br><span class="line"><span class="comment">        Cannot be longer than 4000 characters, since it is returned</span></span><br><span class="line"><span class="comment">        via a query.</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        c_timestamp   CONSTANT VARCHAR2 (100)</span><br><span class="line">            := TO_CHAR (SYSDATE, 'HH24:MI:SS-YYYYMMDD') ;</span><br><span class="line">        l_string               maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        l_string :=</span><br><span class="line">            <span class="keyword">CASE</span></span><br><span class="line">                <span class="keyword">WHEN</span> g_include_timestamp <span class="keyword">THEN</span> c_timestamp || <span class="string">' '</span></span><br><span class="line">                <span class="keyword">ELSE</span> <span class="literal">NULL</span></span><br><span class="line">            <span class="keyword">END</span></span><br><span class="line">            || context_in;</span><br><span class="line">        l_string :=</span><br><span class="line">            l_string || ' - '</span><br><span class="line">            || SUBSTR (text_in</span><br><span class="line">                      ,1</span><br><span class="line">                      ,c_varchar2_max_length_db - LENGTH (l_string) - 5);</span><br><span class="line">        <span class="comment">/* Ignore level</span></span><br><span class="line"><span class="comment">        || CASE</span></span><br><span class="line"><span class="comment">          WHEN level_in &gt; 0</span></span><br><span class="line"><span class="comment">         THEN LPAD (' ', level_in)</span></span><br><span class="line"><span class="comment">          ELSE NULL</span></span><br><span class="line"><span class="comment">         END</span></span><br><span class="line"><span class="comment">        || context_in</span></span><br><span class="line"><span class="comment">        || ' - '</span></span><br><span class="line"><span class="comment">        || text_in;*/</span></span><br><span class="line">        RETURN l_string;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN VALUE_ERROR</span><br><span class="line">        THEN</span><br><span class="line">            RETURN SUBSTR (context_in || ' - ' || text_in</span><br><span class="line">                          ,1</span><br><span class="line">                          ,c_varchar2_max_length);</span><br><span class="line">    <span class="keyword">END</span> full_log_string;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- writes output to the screen or q$log table</span></span><br><span class="line">    <span class="comment">-- (see toscreen and totable above)</span></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,text_in          IN q$log.text%TYPE</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">        <span class="keyword">PRAGMA</span> AUTONOMOUS_TRANSACTION;</span><br><span class="line">        l_context   q$log.context%TYPE;</span><br><span class="line">        l_text      q$log.text%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> trace_enabled (context_in) <span class="keyword">OR</span> force_trace_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="comment">-- Bypass encapsulation; problems with infinite loop.</span></span><br><span class="line">            <span class="keyword">IF</span> g_target = c_table</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                <span class="comment">/* 1.2.18 Avoid context strings &gt; 500 characters */</span></span><br><span class="line">                l_context :=</span><br><span class="line">                    <span class="keyword">CASE</span></span><br><span class="line">                        <span class="keyword">WHEN</span> g_include_timestamp</span><br><span class="line">                        <span class="keyword">THEN</span></span><br><span class="line">                            TO_CHAR (<span class="keyword">SYSDATE</span>, <span class="string">'HH24:MI:SS-YYYYMMDD'</span>) || <span class="string">' '</span></span><br><span class="line">                        <span class="keyword">ELSE</span></span><br><span class="line">                            <span class="literal">NULL</span></span><br><span class="line">                    <span class="keyword">END</span>;</span><br><span class="line">                l_context := SUBSTR (l_context || context_in, 1, 500);</span><br><span class="line">                l_text := SUBSTR (text_in, 1, c_varchar2_max_length_db);</span><br><span class="line"></span><br><span class="line">                <span class="keyword">INSERT</span> <span class="keyword">INTO</span> q$<span class="keyword">log</span> (<span class="keyword">id</span></span><br><span class="line">                                  ,<span class="keyword">context</span></span><br><span class="line">                                  ,<span class="built_in">text</span></span><br><span class="line">                                  ,call_stack</span><br><span class="line">                                  ,created_on</span><br><span class="line">                                  ,created_by)</span><br><span class="line">                <span class="keyword">VALUES</span> (</span><br><span class="line">                           q$log_seq.NEXTVAL</span><br><span class="line">                          ,l_context</span><br><span class="line">                          ,l_text</span><br><span class="line">                          ,<span class="keyword">SUBSTR</span> (DBMS_UTILITY.format_call_stack</span><br><span class="line">                                  ,<span class="number">1</span></span><br><span class="line">                                  ,c_varchar2_max_length_db)</span><br><span class="line">                          ,<span class="keyword">SYSDATE</span></span><br><span class="line">                          ,<span class="keyword">USER</span>);</span><br><span class="line">            ELSIF g_target = c_screen</span><br><span class="line">            THEN</span><br><span class="line">                pl (</span><br><span class="line">                    string_in =&gt; full_log_string (context_in</span><br><span class="line">                                                 ,text_in</span><br><span class="line">                                                 ,level_in));</span><br><span class="line">            <span class="comment">/*</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">              Write to file now occurs in front end when tracing is terminated</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">              ELSIF g_target = c_file</span></span><br><span class="line"><span class="comment">              THEN</span></span><br><span class="line"><span class="comment">             utx_file.put_line (g_file_info.file_handle</span></span><br><span class="line"><span class="comment">              , full_log_string (context_in, text_in, level_in)</span></span><br><span class="line"><span class="comment">             );</span></span><br><span class="line"><span class="comment">             -- 1.2.3: close and reopen file</span></span><br><span class="line"><span class="comment">             g_file_info.lines_written := g_file_info.lines_written + 1;</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">             IF g_file_info.lines_written &gt;= c_close_threshold</span></span><br><span class="line"><span class="comment">             THEN</span></span><br><span class="line"><span class="comment">              utx_file.fclose (g_file_info.file_handle);</span></span><br><span class="line"><span class="comment">              g_file_info.file_handle :=</span></span><br><span class="line"><span class="comment">             utx_file.fopen (g_file_info.dir</span></span><br><span class="line"><span class="comment">             , g_file_info.filename</span></span><br><span class="line"><span class="comment">             , 'A'</span></span><br><span class="line"><span class="comment">             , max_linesize  =&gt; 32767</span></span><br><span class="line"><span class="comment">              );</span></span><br><span class="line"><span class="comment">              g_file_info.lines_written := 0;</span></span><br><span class="line"><span class="comment">             END IF;*/</span></span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">COMMIT</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            <span class="keyword">ROLLBACK</span>;</span><br><span class="line">            RAISE;</span><br><span class="line">    <span class="keyword">END</span> <span class="keyword">trace</span>;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,boolean_in       IN BOOLEAN</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> boolean_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (context_in</span><br><span class="line">                  ,<span class="string">'TRUE'</span></span><br><span class="line">                  ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">                  ,level_in         =&gt; level_in);</span><br><span class="line">        ELSIF NOT boolean_in</span><br><span class="line">        THEN</span><br><span class="line">            trace (context_in</span><br><span class="line">                  ,'FALSE'</span><br><span class="line">                  ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">                  ,level_in         =&gt; level_in);</span><br><span class="line">        ELSE</span><br><span class="line">            trace (context_in</span><br><span class="line">                  ,'NULL BOOLEAN'</span><br><span class="line">                  ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">                  ,level_in         =&gt; level_in);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> <span class="keyword">trace</span>;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,number_in        IN NUMBER</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">trace</span> (context_in</span><br><span class="line">              ,TO_CHAR (number_in)</span><br><span class="line">              ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">              ,level_in         =&gt; level_in);</span><br><span class="line">    <span class="keyword">END</span> <span class="keyword">trace</span>;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,date_in          IN DATE</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">trace</span> (context_in</span><br><span class="line">              ,TO_CHAR (date_in, <span class="string">'YYYY MM DD HH24:MI:SS'</span>)</span><br><span class="line">              ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">              ,level_in         =&gt; level_in);</span><br><span class="line">    <span class="keyword">END</span> <span class="keyword">trace</span>;</span><br><span class="line"></span><br><span class="line">    PROCEDURE trace (context_in       IN q$log.context%TYPE</span><br><span class="line">                    ,clob_in          IN CLOB</span><br><span class="line">                    ,force_trace_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">                    ,level_in         IN PLS_INTEGER DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">        <span class="comment">-- Maximum size set by column restriction</span></span><br><span class="line">        buffer      VARCHAR2 (4000);</span><br><span class="line">        amount      BINARY_INTEGER := 4000;</span><br><span class="line">        position    INTEGER := 1;</span><br><span class="line">        l_notnull   BOOLEAN := FALSE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">LOOP</span></span><br><span class="line">            DBMS_LOB.read (clob_in</span><br><span class="line">                          ,amount</span><br><span class="line">                          ,<span class="keyword">position</span></span><br><span class="line">                          ,buffer);</span><br><span class="line">            l_notnull := TRUE;</span><br><span class="line">            trace (</span><br><span class="line">                CASE WHEN position = 1 THEN context_in ELSE NULL <span class="keyword">END</span></span><br><span class="line">               ,buffer</span><br><span class="line">               ,force_trace_in   =&gt; force_trace_in</span><br><span class="line">               ,level_in         =&gt; <span class="keyword">CASE</span></span><br><span class="line">                                       <span class="keyword">WHEN</span> <span class="keyword">position</span> = <span class="number">1</span> <span class="keyword">THEN</span> level_in</span><br><span class="line">                                       <span class="keyword">ELSE</span> <span class="number">0</span></span><br><span class="line">                                   <span class="keyword">END</span>);</span><br><span class="line">            position := position + amount;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN NO_DATA_FOUND OR VALUE_ERROR</span><br><span class="line">        THEN</span><br><span class="line">            <span class="comment">-- Make sure that at least the trace message is written.</span></span><br><span class="line">            IF NOT l_notnull</span><br><span class="line">            THEN</span><br><span class="line">                trace (context_in</span><br><span class="line">                      ,''</span><br><span class="line">                      ,force_trace_in</span><br><span class="line">                      ,level_in);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> <span class="keyword">trace</span>;</span><br><span class="line"></span><br><span class="line">    FUNCTION build_where_clause_show_trace (</span><br><span class="line">        from_id_in        IN q$log.id%TYPE := NULL</span><br><span class="line">       ,context_like_in   IN VARCHAR2 := '%'</span><br><span class="line">       ,text_like_in      IN VARCHAR2 := '%')</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        l_where   VARCHAR2 (1000);</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> from_id_in <span class="keyword">IS</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            l_where := <span class="string">'1 = 1'</span>;</span><br><span class="line">        ELSE</span><br><span class="line">            l_where := 'id &gt;= ' || from_id_in;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        l_where :=</span><br><span class="line">               l_where</span><br><span class="line">            || ' AND context LIKE ''%'</span><br><span class="line">            || context_like_in</span><br><span class="line">            || '%'' AND text LIKE ''%'</span><br><span class="line">            || text_like_in</span><br><span class="line">            || '%''';</span><br><span class="line">        RETURN l_where;</span><br><span class="line">    <span class="keyword">END</span> build_where_clause_show_trace;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- writes to the console the trace rows</span></span><br><span class="line">    <span class="comment">-- given (optionally filtered in any combination):</span></span><br><span class="line">    <span class="comment">--  trace id, context, text</span></span><br><span class="line">    <span class="comment">-- may be limited by limit_in</span></span><br><span class="line">    <span class="comment">-- call stack can also be displayed</span></span><br><span class="line">    PROCEDURE show_trace (from_id_in              IN q$log.id%TYPE := NULL</span><br><span class="line">                         ,context_like_in         IN VARCHAR2 := '%'</span><br><span class="line">                         ,text_like_in            IN VARCHAR2 := '%'</span><br><span class="line">                         ,limit_in                IN PLS_INTEGER := NULL</span><br><span class="line">                         ,include_call_stack_in   IN BOOLEAN := TRUE)</span><br><span class="line">    IS</span><br><span class="line">        l_where             VARCHAR2 (1000);</span><br><span class="line">        l_entries           q$log_tc;</span><br><span class="line">        l_index             PLS_INTEGER;</span><br><span class="line">        limit_not_reached   BOOLEAN := TRUE;</span><br><span class="line"></span><br><span class="line">        FUNCTION all_logs_by (where_clause_in IN VARCHAR2)</span><br><span class="line">            RETURN q$log_tc</span><br><span class="line">        IS</span><br><span class="line">            TYPE weak_rc IS REF CURSOR;</span><br><span class="line"></span><br><span class="line">            allrows_cur   weak_rc;</span><br><span class="line">            <span class="comment">--1.4.1    l_rows        PLS_INTEGER;</span></span><br><span class="line">            retval        q$log_tc;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            <span class="keyword">OPEN</span> allrows_cur <span class="keyword">FOR</span></span><br><span class="line">                <span class="string">'SELECT</span></span><br><span class="line"><span class="string">                     ID,</span></span><br><span class="line"><span class="string">                     CONTEXT,</span></span><br><span class="line"><span class="string">                     TEXT,</span></span><br><span class="line"><span class="string">                     CALL_STACK,</span></span><br><span class="line"><span class="string">                     CREATED_ON,</span></span><br><span class="line"><span class="string">                     CREATED_BY,</span></span><br><span class="line"><span class="string">                     CHANGED_ON,</span></span><br><span class="line"><span class="string">                     CHANGED_BY</span></span><br><span class="line"><span class="string">              FROM q$log WHERE '</span> || where_clause_in;</span><br><span class="line"></span><br><span class="line">            LOOP</span><br><span class="line">                FETCH allrows_cur INTO retval (retval.COUNT + 1);</span><br><span class="line"></span><br><span class="line">                EXIT WHEN allrows_cur%NOTFOUND;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line"></span><br><span class="line">            RETURN retval;</span><br><span class="line">        <span class="keyword">END</span> all_logs_by;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        l_where :=</span><br><span class="line">            build_where_clause_show_trace (</span><br><span class="line">                from_id_in        =&gt; from_id_in</span><br><span class="line">               ,context_like_in   =&gt; context_like_in</span><br><span class="line">               ,text_like_in      =&gt; text_like_in);</span><br><span class="line">        l_entries := all_logs_by (l_where);</span><br><span class="line">        l_index := l_entries.FIRST;</span><br><span class="line"></span><br><span class="line">        WHILE (l_index IS NOT NULL AND limit_not_reached)</span><br><span class="line">        LOOP</span><br><span class="line">            pl (</span><br><span class="line">                   'ID-Context-Text = '</span><br><span class="line">                || l_entries (l_index).id</span><br><span class="line">                || '-'</span><br><span class="line">                || l_entries (l_index).context</span><br><span class="line">                || '-'</span><br><span class="line">                || l_entries (l_index).text);</span><br><span class="line"></span><br><span class="line">            IF include_call_stack_in</span><br><span class="line">            THEN</span><br><span class="line">                pl (l_entries (l_index).call_stack);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            pl ('<span class="comment">------------------------------------------------');</span></span><br><span class="line">            l_index := l_entries.NEXT (l_index);</span><br><span class="line">            limit_not_reached := (l_index &lt;= limit_in OR limit_in IS NULL);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">    <span class="keyword">END</span> show_trace;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-------------------------------------------</span></span><br><span class="line">    <span class="comment">-- Error handling and raising functionality</span></span><br><span class="line">    <span class="comment">-------------------------------------------</span></span><br><span class="line">    PROCEDURE internal_raise (code_in IN PLS_INTEGER, message_in IN VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">-- 4/2004: Keep this trace call in? Offer it as an option?</span></span><br><span class="line">        <span class="comment">-- 5/2005: Made it optional, based on the trace setting.</span></span><br><span class="line">        <span class="keyword">IF</span> error_trace_enabled</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (</span><br><span class="line">                <span class="string">'ERROR RAISED'</span></span><br><span class="line">               ,   <span class="string">'Oracle error = '</span></span><br><span class="line">                || code_in</span><br><span class="line">                || <span class="string">' - Error instance handle = '</span></span><br><span class="line">                || message_in</span><br><span class="line">               ,<span class="literal">FALSE</span>);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        raise_application_error (code_in, message_in);</span><br><span class="line">    <span class="keyword">END</span> internal_raise;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Global contexts; not tied to any specific instance.</span></span><br><span class="line">    PROCEDURE add_gcontext (NAME_IN    IN q$error_context.name%TYPE</span><br><span class="line">                           ,value_in   IN q$error_context.VALUE%TYPE)</span><br><span class="line">    IS</span><br><span class="line">        l_name      q$error_context.name%TYPE := UPPER (NAME_IN);</span><br><span class="line">        l_row       PLS_INTEGER := g_gcontexts.FIRST;</span><br><span class="line">        l_matched   BOOLEAN := FALSE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">WHILE</span> (l_row <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span> <span class="keyword">AND</span> <span class="keyword">NOT</span> l_matched)</span><br><span class="line">        <span class="keyword">LOOP</span></span><br><span class="line">            l_matched := l_name = g_gcontexts (l_row).name;</span><br><span class="line"></span><br><span class="line">            IF NOT l_matched</span><br><span class="line">            THEN</span><br><span class="line">                l_row := g_gcontexts.NEXT (l_row);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line"></span><br><span class="line">        IF NOT l_matched</span><br><span class="line">        THEN</span><br><span class="line">            l_row := g_gcontexts.COUNT + 1;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        g_gcontexts (l_row).name := l_name;</span><br><span class="line">        g_gcontexts (l_row).VALUE := value_in;</span><br><span class="line">    <span class="keyword">END</span> add_gcontext;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Remove all global contexts.</span></span><br><span class="line">    <span class="comment">-- This is called by mark_q$error_handled as well.</span></span><br><span class="line">    PROCEDURE clear_gcontexts</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_gcontexts.delete;</span><br><span class="line">    <span class="keyword">END</span> clear_gcontexts;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Set a single context value</span></span><br><span class="line">    PROCEDURE add_context (</span><br><span class="line">        error_instance_id_in   IN q$error_instance.id%TYPE</span><br><span class="line">       ,NAME_IN                IN q$error_context.name%TYPE</span><br><span class="line">       ,value_in               IN q$error_context.VALUE%TYPE</span><br><span class="line">       ,validate_in            IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">        <span class="keyword">PRAGMA</span> AUTONOMOUS_TRANSACTION;</span><br><span class="line">        l_error_instance   q$error_instance%ROWTYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> NAME_IN <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">IF</span> validate_in</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                l_error_instance :=</span><br><span class="line">                    q$error_instance_qp_onerow (error_instance_id_in);</span><br><span class="line">            ELSE</span><br><span class="line">                l_error_instance.id := error_instance_id_in;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">INSERT</span> <span class="keyword">INTO</span> q$error_context (<span class="keyword">id</span></span><br><span class="line">                                        ,error_instance_id</span><br><span class="line">                                        ,<span class="keyword">name</span></span><br><span class="line">                                        ,<span class="keyword">VALUE</span>)</span><br><span class="line">            <span class="keyword">VALUES</span> (q$error_context_seq.NEXTVAL</span><br><span class="line">                   ,l_error_instance.id</span><br><span class="line">                   ,NAME_IN</span><br><span class="line">                   ,value_in);</span><br><span class="line"></span><br><span class="line">            <span class="keyword">COMMIT</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    EXCEPTION</span><br><span class="line">        WHEN DUP_VAL_ON_INDEX</span><br><span class="line">        THEN</span><br><span class="line">            <span class="keyword">ROLLBACK</span>;</span><br><span class="line">        WHEN OTHERS</span><br><span class="line">        THEN</span><br><span class="line">            <span class="keyword">ROLLBACK</span>;</span><br><span class="line">            internal_raise (</span><br><span class="line">                c_default_error_code</span><br><span class="line">               ,   'Unable to <span class="keyword">insert</span> QD <span class="keyword">context</span> <span class="keyword">for</span> <span class="string">"'</span></span><br><span class="line"><span class="string">                || NAME_IN</span></span><br><span class="line"><span class="string">                || '"</span> <span class="keyword">with</span> <span class="keyword">value</span> <span class="string">"'</span></span><br><span class="line"><span class="string">                || value_in</span></span><br><span class="line"><span class="string">                || '"</span> <span class="keyword">for</span> <span class="keyword">instance</span> <span class="keyword">ID</span> <span class="string">'</span></span><br><span class="line"><span class="string">                || l_error_instance.id</span></span><br><span class="line"><span class="string">                || '</span> <span class="keyword">with</span> <span class="keyword">Oracle</span> <span class="keyword">error</span> = <span class="string">'</span></span><br><span class="line"><span class="string">                || SQLCODE);</span></span><br><span class="line"><span class="string">    END add_context;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE add_context (err_instance_id_in   IN q$error_instance.id%TYPE</span></span><br><span class="line"><span class="string">                          ,NAME_IN              IN q$error_context.name%TYPE</span></span><br><span class="line"><span class="string">                          ,value_in             IN q$error_context.VALUE%TYPE</span></span><br><span class="line"><span class="string">                          ,validate_in          IN BOOLEAN DEFAULT TRUE)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        add_context (error_instance_id_in   =&gt; err_instance_id_in</span></span><br><span class="line"><span class="string">                    ,NAME_IN                =&gt; NAME_IN</span></span><br><span class="line"><span class="string">                    ,value_in               =&gt; value_in</span></span><br><span class="line"><span class="string">                    ,validate_in            =&gt; validate_in);</span></span><br><span class="line"><span class="string">    END add_context;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    -- An error needs to be raised or logged.</span></span><br><span class="line"><span class="string">    -- Get a message handle for this particular error instance.</span></span><br><span class="line"><span class="string">    -- The "error message" id keeps track of both the error</span></span><br><span class="line"><span class="string">    -- and message information. This program also serves as</span></span><br><span class="line"><span class="string">    -- "record and go" and "go". In other words, we do not</span></span><br><span class="line"><span class="string">    -- raise an error, but it is noted.</span></span><br><span class="line"><span class="string">    --</span></span><br><span class="line"><span class="string">    PROCEDURE register_error_instance (</span></span><br><span class="line"><span class="string">        error_in                IN     q$error%ROWTYPE</span></span><br><span class="line"><span class="string">       ,text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span></span><br><span class="line"><span class="string">       ,error_instance_id_out   IN OUT q$error_instance.id%TYPE</span></span><br><span class="line"><span class="string">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value5_in               IN     VARCHAR2 DEFAULT NULL)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        l_error_instance_id   q$error_instance.id%TYPE;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">        PROCEDURE add_context_values</span></span><br><span class="line"><span class="string">        IS</span></span><br><span class="line"><span class="string">            l_row   PLS_INTEGER;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            PROCEDURE add_one (NAME_IN IN VARCHAR2, value_in IN VARCHAR2)</span></span><br><span class="line"><span class="string">            IS</span></span><br><span class="line"><span class="string">            BEGIN</span></span><br><span class="line"><span class="string">                IF NAME_IN IS NOT NULL</span></span><br><span class="line"><span class="string">                THEN</span></span><br><span class="line"><span class="string">                    INSERT INTO q$error_context (id</span></span><br><span class="line"><span class="string">                                                ,error_instance_id</span></span><br><span class="line"><span class="string">                                                ,name</span></span><br><span class="line"><span class="string">                                                ,VALUE)</span></span><br><span class="line"><span class="string">                    VALUES (q$error_context_seq.NEXTVAL</span></span><br><span class="line"><span class="string">                           ,l_error_instance_id</span></span><br><span class="line"><span class="string">                           ,SUBSTR (NAME_IN, 1, c_varchar2_max_length_db)</span></span><br><span class="line"><span class="string">                           ,SUBSTR (value_in, 1, c_varchar2_max_length_db));</span></span><br><span class="line"><span class="string">                END IF;</span></span><br><span class="line"><span class="string">            EXCEPTION</span></span><br><span class="line"><span class="string">                WHEN DUP_VAL_ON_INDEX</span></span><br><span class="line"><span class="string">                THEN</span></span><br><span class="line"><span class="string">                    -- Entering another value for the same context. Mention it in the trace.</span></span><br><span class="line"><span class="string">                    trace (</span></span><br><span class="line"><span class="string">                        '</span><span class="keyword">ADD</span> <span class="keyword">CONTEXT</span><span class="string">'</span></span><br><span class="line"><span class="string">                       ,   '</span><span class="keyword">Duplicate</span> entry <span class="keyword">for</span> <span class="string">"'</span></span><br><span class="line"><span class="string">                        || NAME_IN</span></span><br><span class="line"><span class="string">                        || '"</span> <span class="keyword">with</span> <span class="keyword">value</span> <span class="string">"'</span></span><br><span class="line"><span class="string">                        || value_in</span></span><br><span class="line"><span class="string">                        || '"</span> <span class="keyword">for</span> <span class="keyword">instance</span> <span class="keyword">ID</span> <span class="string">'</span></span><br><span class="line"><span class="string">                        || l_error_instance_id</span></span><br><span class="line"><span class="string">                       ,TRUE);</span></span><br><span class="line"><span class="string">            END add_one;</span></span><br><span class="line"><span class="string">        BEGIN</span></span><br><span class="line"><span class="string">            add_one (name1_in, value1_in);</span></span><br><span class="line"><span class="string">            add_one (name2_in, value2_in);</span></span><br><span class="line"><span class="string">            add_one (name3_in, value3_in);</span></span><br><span class="line"><span class="string">            add_one (name4_in, value4_in);</span></span><br><span class="line"><span class="string">            add_one (name5_in, value5_in);</span></span><br><span class="line"><span class="string">            --</span></span><br><span class="line"><span class="string">            -- Add any global contexts</span></span><br><span class="line"><span class="string">            l_row := g_gcontexts.FIRST;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            WHILE (l_row IS NOT NULL)</span></span><br><span class="line"><span class="string">            LOOP</span></span><br><span class="line"><span class="string">                add_one (g_gcontexts (l_row).name, g_gcontexts (l_row).VALUE);</span></span><br><span class="line"><span class="string">                l_row := g_gcontexts.NEXT (l_row);</span></span><br><span class="line"><span class="string">            END LOOP;</span></span><br><span class="line"><span class="string">        END add_context_values;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        IF q$error_raised</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            -- Just continue to propagate this error instance.</span></span><br><span class="line"><span class="string">            error_instance_id_out := q$error_instance_id_raised;</span></span><br><span class="line"><span class="string">        ELSE</span></span><br><span class="line"><span class="string">            SELECT q$error_instance_seq.NEXTVAL</span></span><br><span class="line"><span class="string">              INTO l_error_instance_id</span></span><br><span class="line"><span class="string">              FROM DUAL;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            INSERT INTO q$error_instance (id</span></span><br><span class="line"><span class="string">                                         ,error_id</span></span><br><span class="line"><span class="string">                                         ,error_stack</span></span><br><span class="line"><span class="string">                                         ,call_stack</span></span><br><span class="line"><span class="string">                                         ,MESSAGE</span></span><br><span class="line"><span class="string">                                         ,system_error_code</span></span><br><span class="line"><span class="string">                                         ,system_error_message)</span></span><br><span class="line"><span class="string">            VALUES (</span></span><br><span class="line"><span class="string">                       l_error_instance_id</span></span><br><span class="line"><span class="string">                      ,error_in.id</span></span><br><span class="line"><span class="string">                      ,SUBSTR (g_grabbed_settings.error_stack</span></span><br><span class="line"><span class="string">                              ,1</span></span><br><span class="line"><span class="string">                              ,c_varchar2_max_length_db)</span></span><br><span class="line"><span class="string">                      ,SUBSTR (g_grabbed_settings.call_stack</span></span><br><span class="line"><span class="string">                              ,1</span></span><br><span class="line"><span class="string">                              ,c_varchar2_max_length_db)</span></span><br><span class="line"><span class="string">                      ,SUBSTR (text_in, 1, c_varchar2_max_length_db)</span></span><br><span class="line"><span class="string">                      ,SUBSTR (g_grabbed_settings.system_error_code</span></span><br><span class="line"><span class="string">                              ,1</span></span><br><span class="line"><span class="string">                              ,c_varchar2_max_length_db)</span></span><br><span class="line"><span class="string">                      ,SUBSTR (g_grabbed_settings.system_error_message</span></span><br><span class="line"><span class="string">                              ,1</span></span><br><span class="line"><span class="string">                              ,c_varchar2_max_length_db));</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            add_context_values;</span></span><br><span class="line"><span class="string">            mark_q$error_raised (l_error_instance_id);</span></span><br><span class="line"><span class="string">            error_instance_id_out := l_error_instance_id;</span></span><br><span class="line"><span class="string">        END IF;</span></span><br><span class="line"><span class="string">    END register_error_instance;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE grab_settings</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        g_grabbed_settings.system_error_code := SQLCODE;</span></span><br><span class="line"><span class="string">        g_grabbed_settings.system_error_message :=</span></span><br><span class="line"><span class="string">            DBMS_UTILITY.format_error_stack;</span></span><br><span class="line"><span class="string">        g_grabbed_settings.error_stack := error_backtrace;</span></span><br><span class="line"><span class="string">        g_grabbed_settings.call_stack := DBMS_UTILITY.format_call_stack;</span></span><br><span class="line"><span class="string">    END grab_settings;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE register_error (</span></span><br><span class="line"><span class="string">        error_code_in           IN     q$error.code%TYPE</span></span><br><span class="line"><span class="string">       ,error_instance_id_out   IN OUT q$error_instance.id%TYPE</span></span><br><span class="line"><span class="string">       ,text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span></span><br><span class="line"><span class="string">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        PRAGMA AUTONOMOUS_TRANSACTION;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">        FUNCTION error_from_repository (error_code_in IN PLS_INTEGER)</span></span><br><span class="line"><span class="string">            RETURN q$error%ROWTYPE</span></span><br><span class="line"><span class="string">        IS</span></span><br><span class="line"><span class="string">            l_error   q$error%ROWTYPE;</span></span><br><span class="line"><span class="string">        BEGIN</span></span><br><span class="line"><span class="string">            /* If the error code is an Oracle error, do not create</span></span><br><span class="line"><span class="string">             an "undefined" entry in the error log table.</span></span><br><span class="line"><span class="string">              */</span></span><br><span class="line"><span class="string">            BEGIN</span></span><br><span class="line"><span class="string">                SELECT id</span></span><br><span class="line"><span class="string">                  INTO l_error.id</span></span><br><span class="line"><span class="string">                  FROM q$error</span></span><br><span class="line"><span class="string">                 WHERE code = error_code_in;</span></span><br><span class="line"><span class="string">            EXCEPTION</span></span><br><span class="line"><span class="string">                WHEN NO_DATA_FOUND</span></span><br><span class="line"><span class="string">                THEN</span></span><br><span class="line"><span class="string">                    l_error.id := NULL;</span></span><br><span class="line"><span class="string">            END;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            IF l_error.id IS NULL          -- an unknown error; record as such</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                SELECT q$error_seq.NEXTVAL INTO l_error.id FROM DUAL;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                IF is_valid_oracle_error (error_code_in)</span></span><br><span class="line"><span class="string">                THEN</span></span><br><span class="line"><span class="string">                    l_error.name := sqlcode_name (error_code_in);</span></span><br><span class="line"><span class="string">                    l_error.description := sqlcode_text (error_code_in);</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                    INSERT INTO q$error (id</span></span><br><span class="line"><span class="string">                                        ,code</span></span><br><span class="line"><span class="string">                                        ,name</span></span><br><span class="line"><span class="string">                                        ,description</span></span><br><span class="line"><span class="string">                                        ,error_category_name)</span></span><br><span class="line"><span class="string">                    VALUES (l_error.id</span></span><br><span class="line"><span class="string">                           ,error_code_in</span></span><br><span class="line"><span class="string">                           ,l_error.name</span></span><br><span class="line"><span class="string">                           ,l_error.description</span></span><br><span class="line"><span class="string">                           ,'</span><span class="keyword">Oracle</span> <span class="keyword">Error</span><span class="string">');</span></span><br><span class="line"><span class="string">                ELSE</span></span><br><span class="line"><span class="string">                    l_error.name := SQLERRM (error_code_in);</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                    INSERT INTO q$error (id</span></span><br><span class="line"><span class="string">                                        ,code</span></span><br><span class="line"><span class="string">                                        ,name</span></span><br><span class="line"><span class="string">                                        ,description</span></span><br><span class="line"><span class="string">                                        ,error_category_name)</span></span><br><span class="line"><span class="string">                    VALUES (</span></span><br><span class="line"><span class="string">                               l_error.id</span></span><br><span class="line"><span class="string">                              ,error_code_in</span></span><br><span class="line"><span class="string">                              ,l_error.name</span></span><br><span class="line"><span class="string">                              ,'</span>Undefined runtime <span class="keyword">error</span>: <span class="string">' || error_code_in</span></span><br><span class="line"><span class="string">                               || '</span>. You should <span class="keyword">define</span> this <span class="keyword">in</span> the <span class="keyword">error</span> repository.<span class="string">'</span></span><br><span class="line"><span class="string">                              ,'</span>UNDEFINED<span class="string">');</span></span><br><span class="line"><span class="string">                END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                l_error := q$error_qp_onerow (l_error.id);</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            RETURN l_error;</span></span><br><span class="line"><span class="string">        END error_from_repository;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        IF q$error_raised</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            -- Just continue to propagate this error instance.</span></span><br><span class="line"><span class="string">            error_instance_id_out := q$error_instance_id_raised;</span></span><br><span class="line"><span class="string">        ELSE</span></span><br><span class="line"><span class="string">            IF grab_settings_in</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                grab_settings;</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            register_error_instance (</span></span><br><span class="line"><span class="string">                error_from_repository (error_code_in)</span></span><br><span class="line"><span class="string">               ,text_in                 =&gt; text_in</span></span><br><span class="line"><span class="string">               ,error_instance_id_out   =&gt; error_instance_id_out</span></span><br><span class="line"><span class="string">               ,name1_in                =&gt; name1_in</span></span><br><span class="line"><span class="string">               ,value1_in               =&gt; value1_in</span></span><br><span class="line"><span class="string">               ,name2_in                =&gt; name2_in</span></span><br><span class="line"><span class="string">               ,value2_in               =&gt; value2_in</span></span><br><span class="line"><span class="string">               ,name3_in                =&gt; name3_in</span></span><br><span class="line"><span class="string">               ,value3_in               =&gt; value3_in</span></span><br><span class="line"><span class="string">               ,name4_in                =&gt; name4_in</span></span><br><span class="line"><span class="string">               ,value4_in               =&gt; value4_in</span></span><br><span class="line"><span class="string">               ,name5_in                =&gt; name5_in</span></span><br><span class="line"><span class="string">               ,value5_in               =&gt; value5_in);</span></span><br><span class="line"><span class="string">            COMMIT;</span></span><br><span class="line"><span class="string">        END IF;</span></span><br><span class="line"><span class="string">    EXCEPTION</span></span><br><span class="line"><span class="string">        WHEN OTHERS</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            ROLLBACK;</span></span><br><span class="line"><span class="string">            RAISE;</span></span><br><span class="line"><span class="string">    END register_error;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    /* 1.3.6 Standardize arg name - this OL no longer needed</span></span><br><span class="line"><span class="string">    PROCEDURE register_error (</span></span><br><span class="line"><span class="string">       error_code_in       IN     q$error.code%TYPE</span></span><br><span class="line"><span class="string">     , error_instance_id_out IN OUT q$error_instance.id%TYPE</span></span><br><span class="line"><span class="string">     , text_in             IN     q$error_instance.MESSAGE%TYPE:= NULL</span></span><br><span class="line"><span class="string">     , name1_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , value1_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , name2_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , value2_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , name3_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , value3_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , name4_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , value4_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , name5_in            IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , value5_in           IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">     , grab_settings_in    IN     BOOLEAN DEFAULT TRUE</span></span><br><span class="line"><span class="string">    )</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">       register_error (error_code_in =&gt; error_code_in</span></span><br><span class="line"><span class="string">                     , error_instance_id_out =&gt; err_instance_id_out</span></span><br><span class="line"><span class="string">                     , text_in =&gt; text_in</span></span><br><span class="line"><span class="string">                     , name1_in =&gt; name1_in</span></span><br><span class="line"><span class="string">                     , value1_in =&gt; value1_in</span></span><br><span class="line"><span class="string">                     , name2_in =&gt; name2_in</span></span><br><span class="line"><span class="string">                     , value2_in =&gt; value2_in</span></span><br><span class="line"><span class="string">                     , name3_in =&gt; name3_in</span></span><br><span class="line"><span class="string">                     , value3_in =&gt; value3_in</span></span><br><span class="line"><span class="string">                     , name4_in =&gt; name4_in</span></span><br><span class="line"><span class="string">                     , value4_in =&gt; value4_in</span></span><br><span class="line"><span class="string">                     , name5_in =&gt; name5_in</span></span><br><span class="line"><span class="string">                     , value5_in =&gt; value5_in</span></span><br><span class="line"><span class="string">                     , grab_settings_in =&gt; grab_settings_in</span></span><br><span class="line"><span class="string">                      );</span></span><br><span class="line"><span class="string">    END;</span></span><br><span class="line"><span class="string">    */</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE register_error (</span></span><br><span class="line"><span class="string">        error_name_in           IN     q$error.name%TYPE</span></span><br><span class="line"><span class="string">       ,error_instance_id_out   IN OUT q$error_instance.id%TYPE</span></span><br><span class="line"><span class="string">       ,text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span></span><br><span class="line"><span class="string">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        PRAGMA AUTONOMOUS_TRANSACTION;</span></span><br><span class="line"><span class="string">        l_error   q$error%ROWTYPE;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        IF q$error_raised</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            -- Just continue to propagate this error instance.</span></span><br><span class="line"><span class="string">            error_instance_id_out := q$error_instance_id_raised;</span></span><br><span class="line"><span class="string">        ELSE</span></span><br><span class="line"><span class="string">            IF grab_settings_in</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                grab_settings;</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            BEGIN</span></span><br><span class="line"><span class="string">                SELECT id</span></span><br><span class="line"><span class="string">                  INTO l_error.id</span></span><br><span class="line"><span class="string">                  FROM q$error</span></span><br><span class="line"><span class="string">                 WHERE name = error_name_in;</span></span><br><span class="line"><span class="string">            EXCEPTION</span></span><br><span class="line"><span class="string">                WHEN NO_DATA_FOUND</span></span><br><span class="line"><span class="string">                THEN</span></span><br><span class="line"><span class="string">                    l_error.id := NULL;    -- Create new error if not present.</span></span><br><span class="line"><span class="string">            END;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            IF l_error.id IS NULL          -- an unknown error; record as such</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                SELECT q$error_seq.NEXTVAL INTO l_error.id FROM DUAL;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                INSERT INTO q$error (id, name, description)</span></span><br><span class="line"><span class="string">                VALUES (</span></span><br><span class="line"><span class="string">                           l_error.id</span></span><br><span class="line"><span class="string">                          ,error_name_in</span></span><br><span class="line"><span class="string">                          ,'</span>Undefined runtime <span class="keyword">error</span>: <span class="string">' || error_name_in</span></span><br><span class="line"><span class="string">                           || '</span>. You should <span class="keyword">define</span> this <span class="keyword">in</span> the <span class="keyword">error</span> repository.<span class="string">');</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">                l_error := q$error_qp_onerow (l_error.id);</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            register_error_instance (</span></span><br><span class="line"><span class="string">                l_error</span></span><br><span class="line"><span class="string">               ,text_in                 =&gt; text_in</span></span><br><span class="line"><span class="string">               ,error_instance_id_out   =&gt; error_instance_id_out</span></span><br><span class="line"><span class="string">               ,name1_in                =&gt; name1_in</span></span><br><span class="line"><span class="string">               ,value1_in               =&gt; value1_in</span></span><br><span class="line"><span class="string">               ,name2_in                =&gt; name2_in</span></span><br><span class="line"><span class="string">               ,value2_in               =&gt; value2_in</span></span><br><span class="line"><span class="string">               ,name3_in                =&gt; name3_in</span></span><br><span class="line"><span class="string">               ,value3_in               =&gt; value3_in</span></span><br><span class="line"><span class="string">               ,name4_in                =&gt; name4_in</span></span><br><span class="line"><span class="string">               ,value4_in               =&gt; value4_in</span></span><br><span class="line"><span class="string">               ,name5_in                =&gt; name5_in</span></span><br><span class="line"><span class="string">               ,value5_in               =&gt; value5_in);</span></span><br><span class="line"><span class="string">            COMMIT;</span></span><br><span class="line"><span class="string">        END IF;</span></span><br><span class="line"><span class="string">    END register_error;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE register_error (</span></span><br><span class="line"><span class="string">        error_code_in      IN q$error.code%TYPE</span></span><br><span class="line"><span class="string">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span></span><br><span class="line"><span class="string">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        l_error_instance_id   q$error_instance.id%TYPE;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        IF q$error_raised</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            -- Just continue to propagate this error instance.</span></span><br><span class="line"><span class="string">            l_error_instance_id := q$error_instance_id_raised;</span></span><br><span class="line"><span class="string">        ELSE</span></span><br><span class="line"><span class="string">            IF grab_settings_in</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                grab_settings;</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            register_error (error_code_in           =&gt; error_code_in</span></span><br><span class="line"><span class="string">                           ,error_instance_id_out   =&gt; l_error_instance_id</span></span><br><span class="line"><span class="string">                           ,text_in                 =&gt; text_in</span></span><br><span class="line"><span class="string">                           ,name1_in                =&gt; name1_in</span></span><br><span class="line"><span class="string">                           ,value1_in               =&gt; value1_in</span></span><br><span class="line"><span class="string">                           ,name2_in                =&gt; name2_in</span></span><br><span class="line"><span class="string">                           ,value2_in               =&gt; value2_in</span></span><br><span class="line"><span class="string">                           ,name3_in                =&gt; name3_in</span></span><br><span class="line"><span class="string">                           ,value3_in               =&gt; value3_in</span></span><br><span class="line"><span class="string">                           ,name4_in                =&gt; name4_in</span></span><br><span class="line"><span class="string">                           ,value4_in               =&gt; value4_in</span></span><br><span class="line"><span class="string">                           ,name5_in                =&gt; name5_in</span></span><br><span class="line"><span class="string">                           ,value5_in               =&gt; value5_in</span></span><br><span class="line"><span class="string">                           ,grab_settings_in        =&gt; FALSE);</span></span><br><span class="line"><span class="string">        END IF;</span></span><br><span class="line"><span class="string">    END register_error;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE register_error (</span></span><br><span class="line"><span class="string">        error_name_in      IN q$error.name%TYPE</span></span><br><span class="line"><span class="string">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span></span><br><span class="line"><span class="string">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span></span><br><span class="line"><span class="string">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        l_error_instance_id   q$error_instance.id%TYPE;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        IF q$error_raised</span></span><br><span class="line"><span class="string">        THEN</span></span><br><span class="line"><span class="string">            -- Just continue to propagate this error instance.</span></span><br><span class="line"><span class="string">            l_error_instance_id := q$error_instance_id_raised;</span></span><br><span class="line"><span class="string">        ELSE</span></span><br><span class="line"><span class="string">            IF grab_settings_in</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                grab_settings;</span></span><br><span class="line"><span class="string">            END IF;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">            register_error (error_name_in           =&gt; error_name_in</span></span><br><span class="line"><span class="string">                           ,error_instance_id_out   =&gt; l_error_instance_id</span></span><br><span class="line"><span class="string">                           ,text_in                 =&gt; text_in</span></span><br><span class="line"><span class="string">                           ,name1_in                =&gt; name1_in</span></span><br><span class="line"><span class="string">                           ,value1_in               =&gt; value1_in</span></span><br><span class="line"><span class="string">                           ,name2_in                =&gt; name2_in</span></span><br><span class="line"><span class="string">                           ,value2_in               =&gt; value2_in</span></span><br><span class="line"><span class="string">                           ,name3_in                =&gt; name3_in</span></span><br><span class="line"><span class="string">                           ,value3_in               =&gt; value3_in</span></span><br><span class="line"><span class="string">                           ,name4_in                =&gt; name4_in</span></span><br><span class="line"><span class="string">                           ,value4_in               =&gt; value4_in</span></span><br><span class="line"><span class="string">                           ,name5_in                =&gt; name5_in</span></span><br><span class="line"><span class="string">                           ,value5_in               =&gt; value5_in);</span></span><br><span class="line"><span class="string">        END IF;</span></span><br><span class="line"><span class="string">    END register_error;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    /* V1.2.11 Allow user to specify that Oracle errors should be passed</span></span><br><span class="line"><span class="string">     directly in the Oracle error information, and not hidden</span></span><br><span class="line"><span class="string">     behind the "error instance" information.</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">     "Hide" (don'</span>t <span class="keyword">show</span>) <span class="keyword">is</span> the <span class="keyword">default</span> setting.</span><br><span class="line">    */</span><br><span class="line">    <span class="keyword">PROCEDURE</span> show_oracle_error (</span><br><span class="line">        show_in                 <span class="keyword">IN</span> <span class="built_in">BOOLEAN</span></span><br><span class="line">       ,revert_after_raise_in   <span class="keyword">IN</span> <span class="built_in">BOOLEAN</span> <span class="keyword">DEFAULT</span> <span class="literal">FALSE</span>)</span><br><span class="line">    <span class="keyword">IS</span></span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_show_oracle.show := NVL (show_in, <span class="literal">FALSE</span>);</span><br><span class="line"></span><br><span class="line">        IF g_show_oracle.revert</span><br><span class="line">        THEN</span><br><span class="line">            g_show_oracle.revert_to := g_show_oracle.show;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        g_show_oracle.revert := NVL (revert_after_raise_in, FALSE);</span><br><span class="line">    <span class="keyword">END</span> show_oracle_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE revert_oracle_error</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> g_show_oracle.revert</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            g_show_oracle.show := g_show_oracle.revert_to;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> revert_oracle_error;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Now raise the error that has been defined.</span></span><br><span class="line">    PROCEDURE raise_error_instance (</span><br><span class="line">        error_instance_id_in IN q$error_instance.id%TYPE)</span><br><span class="line">    IS</span><br><span class="line">        l_error_instance   q$error_instance%ROWTYPE;</span><br><span class="line"></span><br><span class="line">        PROCEDURE issue_oracle_raise (</span><br><span class="line">            error_instance_in IN q$error_instance%ROWTYPE)</span><br><span class="line">        IS</span><br><span class="line">            l_error        q$error%ROWTYPE;</span><br><span class="line">            l_error_code   PLS_INTEGER;</span><br><span class="line">            l_error_info   error_info_rt;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            l_error := q$error_qp_onerow (id_in =&gt; error_instance_in.error_id);</span><br><span class="line">            l_error_code :=</span><br><span class="line">                NVL (l_error.code, error_instance_in.system_error_code);</span><br><span class="line"></span><br><span class="line">            <span class="comment">/* 1.2.12 If raising with message, load up the error message string. */</span></span><br><span class="line">            IF raising_with_message ()</span><br><span class="line">            THEN</span><br><span class="line">                get_error_info (error_instance_in.id, l_error_info);</span><br><span class="line">                internal_raise (</span><br><span class="line">                    c_default_error_code</span><br><span class="line">                   ,   'Error Code = '</span><br><span class="line">                    || l_error_info.code</span><br><span class="line">                    || CHR (10)</span><br><span class="line">                    || 'Error Message = '</span><br><span class="line">                    || l_error_info.text</span><br><span class="line">                    || CHR (10)</span><br><span class="line">                    || CHR (10)</span><br><span class="line">                    || 'Error Stack = '</span><br><span class="line">                    || l_error_info.error_stack</span><br><span class="line">                    || CHR (10)</span><br><span class="line">                    || '<span class="keyword">Call</span> Stack = <span class="string">'</span></span><br><span class="line"><span class="string">                    || l_error_info.call_stack);</span></span><br><span class="line"><span class="string">            ELSIF oracle_app_error (l_error_code)</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                internal_raise (l_error_code, error_instance_in.MESSAGE);</span></span><br><span class="line"><span class="string">            -- 1.0.5 Special case needed; cannot use EXCEPTION INIT with -1403 error.</span></span><br><span class="line"><span class="string">            ELSIF l_error_code IN (100, -1403)</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                RAISE NO_DATA_FOUND;</span></span><br><span class="line"><span class="string">            ELSIF l_error_code = 1</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                -- Undefined error information.</span></span><br><span class="line"><span class="string">                internal_raise (</span></span><br><span class="line"><span class="string">                    c_default_error_code</span></span><br><span class="line"><span class="string">                   ,NVL (error_instance_in.MESSAGE, '</span><span class="keyword">User</span>-defined <span class="keyword">error</span><span class="string">'));</span></span><br><span class="line"><span class="string">            /* No Oracle error (0). */</span></span><br><span class="line"><span class="string">            ELSIF l_error_code = 0</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                internal_raise (c_default_error_code</span></span><br><span class="line"><span class="string">                               ,error_instance_in.MESSAGE);</span></span><br><span class="line"><span class="string">            /* Using positive error numbers or we have an error instance</span></span><br><span class="line"><span class="string">             with no error code (runtime-defined error). */</span></span><br><span class="line"><span class="string">            ELSIF l_error_code &gt; 0</span></span><br><span class="line"><span class="string">                  OR (l_error_code IS NULL</span></span><br><span class="line"><span class="string">                      AND error_instance_in.id IS NOT NULL)</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                internal_raise (</span></span><br><span class="line"><span class="string">                    c_default_error_code</span></span><br><span class="line"><span class="string">                   ,c_error_prefix</span></span><br><span class="line"><span class="string">                    || LPAD (TO_CHAR (error_instance_in.id)</span></span><br><span class="line"><span class="string">                            ,c_error_code_len</span></span><br><span class="line"><span class="string">                            ,'</span><span class="number">0</span><span class="string">')</span></span><br><span class="line"><span class="string">                    || c_oracle_separator</span></span><br><span class="line"><span class="string">                    || LPAD (</span></span><br><span class="line"><span class="string">                           TO_CHAR (</span></span><br><span class="line"><span class="string">                               ABS (error_instance_in.system_error_code))</span></span><br><span class="line"><span class="string">                          ,c_oracle_code_len</span></span><br><span class="line"><span class="string">                          ,'</span><span class="number">0</span><span class="string">'));</span></span><br><span class="line"><span class="string">            -- We have a message to pass back, at least.</span></span><br><span class="line"><span class="string">            ELSIF l_error_code IS NULL</span></span><br><span class="line"><span class="string">                  AND error_instance_in.MESSAGE IS NOT NULL</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                internal_raise (c_default_error_code</span></span><br><span class="line"><span class="string">                               ,error_instance_in.MESSAGE);</span></span><br><span class="line"><span class="string">            ELSIF is_valid_oracle_error (l_error_code)</span></span><br><span class="line"><span class="string">            THEN</span></span><br><span class="line"><span class="string">                /* Negative Oracle error. */</span></span><br><span class="line"><span class="string">                EXECUTE IMMEDIATE   '</span><span class="keyword">DECLARE</span> <span class="string">'</span></span><br><span class="line"><span class="string">                                 || '</span>   myexc <span class="keyword">EXCEPTION</span>; '</span><br><span class="line">                                 || '   <span class="keyword">PRAGMA</span> EXCEPTION_INIT (myexc, <span class="string">'</span></span><br><span class="line"><span class="string">                                 || TO_CHAR (l_error_code)</span></span><br><span class="line"><span class="string">                                 || '</span>);'</span><br><span class="line">                                 || '<span class="keyword">BEGIN</span> <span class="string">'</span></span><br><span class="line"><span class="string">                                 || '</span>   <span class="keyword">RAISE</span> myexc;'</span><br><span class="line">                                 || '<span class="keyword">END</span>;';</span><br><span class="line">            ELSE</span><br><span class="line">                <span class="comment">-- Undefined error information.</span></span><br><span class="line">                internal_raise (</span><br><span class="line">                    c_default_error_code</span><br><span class="line">                   ,   'Unable to raise error instance '</span><br><span class="line">                    || error_instance_id_in</span><br><span class="line">                    || ' with error code '</span><br><span class="line">                    || l_error_code);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> issue_oracle_raise;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        l_error_instance := q$error_instance_qp_onerow (error_instance_id_in);</span><br><span class="line">        <span class="comment">-- Turn back on when we can check individual context values</span></span><br><span class="line">        <span class="comment">-- to see if they are required.</span></span><br><span class="line">        <span class="comment">--check_contexts (error_instance_in =&gt; l_error_instance);</span></span><br><span class="line">        issue_oracle_raise (l_error_instance);</span><br><span class="line">    <span class="keyword">END</span> raise_error_instance;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name - this OL not needed</span></span><br><span class="line"><span class="comment">    PROCEDURE raise_error_instance (</span></span><br><span class="line"><span class="comment">       error_instance_id_in IN q$error_instance.id%TYPE</span></span><br><span class="line"><span class="comment">    )</span></span><br><span class="line"><span class="comment">    IS</span></span><br><span class="line"><span class="comment">    BEGIN</span></span><br><span class="line"><span class="comment">       raise_error_instance (error_instance_id_in =&gt; err_instance_id_in);</span></span><br><span class="line"><span class="comment">    END;*/</span></span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_error (</span><br><span class="line">        error_code_in      IN q$error.code%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">        l_error_instance_id   q$error_instance.id%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> q$error_raised</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="comment">-- Just continue to propagate this error instance.</span></span><br><span class="line">            l_error_instance_id := q$error_instance_id_raised;</span><br><span class="line">        ELSE</span><br><span class="line">            IF grab_settings_in</span><br><span class="line">            THEN</span><br><span class="line">                grab_settings;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            register_error (error_code_in           =&gt; error_code_in</span><br><span class="line">                           ,error_instance_id_out   =&gt; l_error_instance_id</span><br><span class="line">                           ,text_in                 =&gt; text_in</span><br><span class="line">                           ,name1_in                =&gt; name1_in</span><br><span class="line">                           ,value1_in               =&gt; value1_in</span><br><span class="line">                           ,name2_in                =&gt; name2_in</span><br><span class="line">                           ,value2_in               =&gt; value2_in</span><br><span class="line">                           ,name3_in                =&gt; name3_in</span><br><span class="line">                           ,value3_in               =&gt; value3_in</span><br><span class="line">                           ,name4_in                =&gt; name4_in</span><br><span class="line">                           ,value4_in               =&gt; value4_in</span><br><span class="line">                           ,name5_in                =&gt; name5_in</span><br><span class="line">                           ,value5_in               =&gt; value5_in</span><br><span class="line">                           ,grab_settings_in        =&gt; FALSE);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        raise_error_instance (error_instance_id_in =&gt; l_error_instance_id);</span><br><span class="line">    <span class="keyword">END</span> raise_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_error (</span><br><span class="line">        error_name_in      IN q$error.name%TYPE</span><br><span class="line">       ,text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">        l_error_instance_id   q$error_instance.id%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> q$error_raised</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="comment">-- Just continue to propagate this error instance.</span></span><br><span class="line">            l_error_instance_id := q$error_instance_id_raised;</span><br><span class="line">        ELSE</span><br><span class="line">            IF grab_settings_in</span><br><span class="line">            THEN</span><br><span class="line">                grab_settings;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            register_error (error_name_in           =&gt; error_name_in</span><br><span class="line">                           ,error_instance_id_out   =&gt; l_error_instance_id</span><br><span class="line">                           ,text_in                 =&gt; text_in</span><br><span class="line">                           ,name1_in                =&gt; name1_in</span><br><span class="line">                           ,value1_in               =&gt; value1_in</span><br><span class="line">                           ,name2_in                =&gt; name2_in</span><br><span class="line">                           ,value2_in               =&gt; value2_in</span><br><span class="line">                           ,name3_in                =&gt; name3_in</span><br><span class="line">                           ,value3_in               =&gt; value3_in</span><br><span class="line">                           ,name4_in                =&gt; name4_in</span><br><span class="line">                           ,value4_in               =&gt; value4_in</span><br><span class="line">                           ,name5_in                =&gt; name5_in</span><br><span class="line">                           ,value5_in               =&gt; value5_in</span><br><span class="line">                           ,grab_settings_in        =&gt; FALSE);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        raise_error_instance (error_instance_id_in =&gt; l_error_instance_id);</span><br><span class="line">    <span class="keyword">END</span> raise_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_unanticipated (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        raise_error (error_code_in      =&gt; <span class="keyword">SQLCODE</span>   <span class="comment">/*'UNANTICIPATED-ERROR'*/</span></span><br><span class="line">                    ,text_in            =&gt; text_in</span><br><span class="line">                    ,name1_in           =&gt; name1_in</span><br><span class="line">                    ,value1_in          =&gt; value1_in</span><br><span class="line">                    ,name2_in           =&gt; name2_in</span><br><span class="line">                    ,value2_in          =&gt; value2_in</span><br><span class="line">                    ,name3_in           =&gt; name3_in</span><br><span class="line">                    ,value3_in          =&gt; value3_in</span><br><span class="line">                    ,name4_in           =&gt; name4_in</span><br><span class="line">                    ,value4_in          =&gt; value4_in</span><br><span class="line">                    ,name5_in           =&gt; name5_in</span><br><span class="line">                    ,value5_in          =&gt; value5_in</span><br><span class="line">                    ,grab_settings_in   =&gt; grab_settings_in);</span><br><span class="line">    <span class="keyword">END</span> raise_unanticipated;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* V1.2.11 Allow user to specify that an Oracle error should be registered</span></span><br><span class="line"><span class="comment">     (but not re-raised) or raised (registered and re-raised).</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    PROCEDURE register_oracle_error (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">/* 1.2.15 Call register, not raise */</span></span><br><span class="line">        register_error (error_code_in      =&gt; <span class="keyword">SQLCODE</span></span><br><span class="line">                       ,text_in            =&gt; text_in</span><br><span class="line">                       ,name1_in           =&gt; name1_in</span><br><span class="line">                       ,value1_in          =&gt; value1_in</span><br><span class="line">                       ,name2_in           =&gt; name2_in</span><br><span class="line">                       ,value2_in          =&gt; value2_in</span><br><span class="line">                       ,name3_in           =&gt; name3_in</span><br><span class="line">                       ,value3_in          =&gt; value3_in</span><br><span class="line">                       ,name4_in           =&gt; name4_in</span><br><span class="line">                       ,value4_in          =&gt; value4_in</span><br><span class="line">                       ,name5_in           =&gt; name5_in</span><br><span class="line">                       ,value5_in          =&gt; value5_in</span><br><span class="line">                       ,grab_settings_in   =&gt; grab_settings_in);</span><br><span class="line">    <span class="keyword">END</span> register_oracle_error;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.2.15 Return error instance */</span></span><br><span class="line">    PROCEDURE register_oracle_error (</span><br><span class="line">        text_in                 IN     q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in                IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in               IN     VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in        IN     BOOLEAN DEFAULT TRUE</span><br><span class="line">       ,error_instance_id_out      OUT q$error_instance.id%TYPE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        register_error (error_code_in           =&gt; <span class="keyword">SQLCODE</span></span><br><span class="line">                       ,error_instance_id_out   =&gt; error_instance_id_out</span><br><span class="line">                       ,text_in                 =&gt; text_in</span><br><span class="line">                       ,name1_in                =&gt; name1_in</span><br><span class="line">                       ,value1_in               =&gt; value1_in</span><br><span class="line">                       ,name2_in                =&gt; name2_in</span><br><span class="line">                       ,value2_in               =&gt; value2_in</span><br><span class="line">                       ,name3_in                =&gt; name3_in</span><br><span class="line">                       ,value3_in               =&gt; value3_in</span><br><span class="line">                       ,name4_in                =&gt; name4_in</span><br><span class="line">                       ,value4_in               =&gt; value4_in</span><br><span class="line">                       ,name5_in                =&gt; name5_in</span><br><span class="line">                       ,value5_in               =&gt; value5_in</span><br><span class="line">                       ,grab_settings_in        =&gt; grab_settings_in);</span><br><span class="line">    <span class="keyword">END</span> register_oracle_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE raise_oracle_error (</span><br><span class="line">        text_in            IN q$error_instance.MESSAGE%TYPE := NULL</span><br><span class="line">       ,name1_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in           IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in          IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,grab_settings_in   IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        raise_error (error_code_in      =&gt; <span class="keyword">SQLCODE</span></span><br><span class="line">                    ,text_in            =&gt; text_in</span><br><span class="line">                    ,name1_in           =&gt; name1_in</span><br><span class="line">                    ,value1_in          =&gt; value1_in</span><br><span class="line">                    ,name2_in           =&gt; name2_in</span><br><span class="line">                    ,value2_in          =&gt; value2_in</span><br><span class="line">                    ,name3_in           =&gt; name3_in</span><br><span class="line">                    ,value3_in          =&gt; value3_in</span><br><span class="line">                    ,name4_in           =&gt; name4_in</span><br><span class="line">                    ,value4_in          =&gt; value4_in</span><br><span class="line">                    ,name5_in           =&gt; name5_in</span><br><span class="line">                    ,value5_in          =&gt; value5_in</span><br><span class="line">                    ,grab_settings_in   =&gt; grab_settings_in);</span><br><span class="line">    <span class="keyword">END</span> raise_oracle_error;</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Retrieval of error information</span></span><br><span class="line">    PROCEDURE parse_message (string_in               IN     VARCHAR2</span><br><span class="line">                            ,error_instance_id_out      OUT PLS_INTEGER</span><br><span class="line">                            ,extra_out                  OUT VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">        l_startloc   PLS_INTEGER := INSTR (string_in, ':');</span><br><span class="line">        <span class="comment">--1.4.1    l_endloc     PLS_INTEGER;</span></span><br><span class="line">        l_errmsg     q$error.description%TYPE</span><br><span class="line">                         := LTRIM (SUBSTR (string_in, l_startloc + 1));</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="comment">/* V1.2.11 Get latest instance from global package variable.</span></span><br><span class="line"><span class="comment">         If that is not available, then fall back on the</span></span><br><span class="line"><span class="comment">         error message; in any case try to extract the</span></span><br><span class="line"><span class="comment">         extra text.</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        <span class="keyword">IF</span> <span class="comment">/* 1.2.14 Do not directly reference variables</span></span><br><span class="line"><span class="comment">          g_error_instance_raised */</span></span><br><span class="line">          q$error_instance_id_raised () <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            error_instance_id_out := q$error_instance_id_raised ();</span><br><span class="line">        ELSE</span><br><span class="line">            IF SUBSTR (LTRIM (l_errmsg), 1, c_error_prefix_len) =</span><br><span class="line">                   c_error_prefix</span><br><span class="line">            THEN</span><br><span class="line">                error_instance_id_out :=</span><br><span class="line">                    TO_NUMBER (</span><br><span class="line">                        SUBSTR (l_errmsg</span><br><span class="line">                               ,c_error_prefix_len + 1</span><br><span class="line">                               ,c_error_code_len));</span><br><span class="line">            ELSE</span><br><span class="line">                error_instance_id_out := NULL;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        extra_out :=</span><br><span class="line">            SUBSTR (l_errmsg, c_error_prefix_len + c_error_code_len + 1);</span><br><span class="line">    <span class="keyword">END</span> parse_message;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_instance_from_string (string_in IN VARCHAR2)</span><br><span class="line">        RETURN PLS_INTEGER</span><br><span class="line">    IS</span><br><span class="line">        l_errmsg   q$error.description%TYPE;</span><br><span class="line">        retval     PLS_INTEGER;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        parse_message (string_in, retval, l_errmsg);</span><br><span class="line">        RETURN retval;</span><br><span class="line">    <span class="keyword">END</span> error_instance_from_string;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_instance_from_sqlerrm</span><br><span class="line">        RETURN PLS_INTEGER</span><br><span class="line">    IS</span><br><span class="line">    <span class="comment">--1.4.1     l_loc      PLS_INTEGER;</span></span><br><span class="line">    <span class="comment">--1.4.1   l_errmsg   q$error.description%TYPE;</span></span><br><span class="line">    <span class="comment">--1.4.1    retval     PLS_INTEGER;</span></span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> error_instance_from_string (DBMS_UTILITY.format_error_stack);</span><br><span class="line">    <span class="keyword">END</span> error_instance_from_sqlerrm;</span><br><span class="line"></span><br><span class="line">    PROCEDURE substitute_strings (</span><br><span class="line">        error_message_inout    IN OUT q$error.substitute_string%TYPE</span><br><span class="line">       ,recommendation_inout   IN OUT q$error.recommendation%TYPE</span><br><span class="line">       ,contexts_inout         IN OUT q$error_context_tc)</span><br><span class="line">    IS</span><br><span class="line">        l_row   PLS_INTEGER;</span><br><span class="line"></span><br><span class="line">        <span class="comment">--1.4.1   retval   q$error.substitute_string%TYPE;</span></span><br><span class="line"></span><br><span class="line">        PROCEDURE replace_all_occurrences (</span><br><span class="line">            context_in       IN q$error_context%ROWTYPE</span><br><span class="line">           ,context_row_in   IN PLS_INTEGER)</span><br><span class="line">        IS</span><br><span class="line">            <span class="comment">-- Maintain format of string while doing replacements on</span></span><br><span class="line">            <span class="comment">-- on named strings case IN sensitively.</span></span><br><span class="line">            c_upper_subst_name   q$error_context.name%TYPE</span><br><span class="line">                := c_subst_char || UPPER (context_in.name);</span><br><span class="line">            c_len                PLS_INTEGER := LENGTH (context_in.name);</span><br><span class="line">            l_loc                PLS_INTEGER;</span><br><span class="line">            l_found              BOOLEAN DEFAULT FALSE;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            <span class="keyword">IF</span> error_message_inout <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                <span class="keyword">LOOP</span></span><br><span class="line">                    l_loc :=</span><br><span class="line">                        <span class="keyword">INSTR</span> (<span class="keyword">UPPER</span> (error_message_inout)</span><br><span class="line">                              ,c_upper_subst_name</span><br><span class="line">                              ,<span class="number">1</span>);</span><br><span class="line">                    EXIT WHEN l_loc = 0;</span><br><span class="line">                    l_found := TRUE;</span><br><span class="line">                    error_message_inout :=</span><br><span class="line">                           SUBSTR (error_message_inout, 1, l_loc - 1)</span><br><span class="line">                        || context_in.VALUE</span><br><span class="line">                        || SUBSTR (error_message_inout, l_loc + c_len + 1);</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            IF recommendation_inout IS NOT NULL</span><br><span class="line">            THEN</span><br><span class="line">                LOOP</span><br><span class="line">                    l_loc :=</span><br><span class="line">                        INSTR (UPPER (recommendation_inout)</span><br><span class="line">                              ,c_upper_subst_name</span><br><span class="line">                              ,1);</span><br><span class="line">                    EXIT WHEN l_loc = 0;</span><br><span class="line">                    l_found := TRUE;</span><br><span class="line">                    recommendation_inout :=</span><br><span class="line">                           SUBSTR (recommendation_inout, 1, l_loc - 1)</span><br><span class="line">                        || context_in.VALUE</span><br><span class="line">                        || SUBSTR (recommendation_inout, l_loc + c_len + 1);</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            IF l_found</span><br><span class="line">            THEN</span><br><span class="line">                contexts_inout.delete (context_row_in);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> replace_all_occurrences;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> error_message_inout <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">           <span class="keyword">OR</span> recommendation_inout <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            l_row := contexts_inout.FIRST;</span><br><span class="line"></span><br><span class="line">            WHILE (l_row IS NOT NULL)</span><br><span class="line">            LOOP</span><br><span class="line">                replace_all_occurrences (contexts_inout (l_row), l_row);</span><br><span class="line">                l_row := contexts_inout.NEXT (l_row);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> substitute_strings;</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in   IN     q$error_instance.id%TYPE</span><br><span class="line">       ,error_info_out            OUT error_info_rt</span><br><span class="line">       ,context_delimiter_in   IN     VARCHAR2 DEFAULT c_newline)</span><br><span class="line">    IS</span><br><span class="line">        l_error_instance   q$error_instance%ROWTYPE;</span><br><span class="line">        l_error            q$error%ROWTYPE;</span><br><span class="line"></span><br><span class="line">        PROCEDURE subst_for_msg_help_strings</span><br><span class="line">        IS</span><br><span class="line">            l_contexts   q$error_context_tc;</span><br><span class="line"></span><br><span class="line">            PROCEDURE add_to_text (new_string_in IN VARCHAR2)</span><br><span class="line">            IS</span><br><span class="line">            <span class="keyword">BEGIN</span></span><br><span class="line">                <span class="keyword">IF</span> new_string_in <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    error_info_out.text :=</span><br><span class="line">                        error_info_out.text</span><br><span class="line">                        || <span class="keyword">CASE</span></span><br><span class="line">                               <span class="keyword">WHEN</span> error_info_out.text <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">                               <span class="keyword">THEN</span></span><br><span class="line">                                   context_delimiter_in</span><br><span class="line">                               <span class="keyword">ELSE</span></span><br><span class="line">                                   <span class="literal">NULL</span></span><br><span class="line">                           <span class="keyword">END</span></span><br><span class="line">                        || new_string_in;</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">            <span class="keyword">END</span> add_to_text;</span><br><span class="line"></span><br><span class="line">            PROCEDURE add_to_context (new_string_in IN VARCHAR2)</span><br><span class="line">            IS</span><br><span class="line">            <span class="keyword">BEGIN</span></span><br><span class="line">                <span class="keyword">IF</span> new_string_in <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">                <span class="keyword">THEN</span></span><br><span class="line">                    error_info_out.contexts :=</span><br><span class="line">                        <span class="keyword">CASE</span></span><br><span class="line">                            <span class="keyword">WHEN</span> error_info_out.contexts <span class="keyword">IS</span> <span class="keyword">NOT</span> <span class="literal">NULL</span></span><br><span class="line">                            <span class="keyword">THEN</span></span><br><span class="line">                                   error_info_out.contexts</span><br><span class="line">                                || context_delimiter_in</span><br><span class="line">                                || new_string_in</span><br><span class="line">                            <span class="keyword">ELSE</span></span><br><span class="line">                                new_string_in</span><br><span class="line">                        <span class="keyword">END</span>;</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">            <span class="keyword">END</span> add_to_context;</span><br><span class="line"></span><br><span class="line">            PROCEDURE add_remaining_contexts</span><br><span class="line">            IS</span><br><span class="line">                l_row   PLS_INTEGER;</span><br><span class="line">            <span class="keyword">BEGIN</span></span><br><span class="line">                l_row := l_contexts.FIRST;</span><br><span class="line"></span><br><span class="line">                IF l_row IS NOT NULL</span><br><span class="line">                THEN</span><br><span class="line">                    <span class="comment">-- Insert a blank line.</span></span><br><span class="line">                    add_to_context (' ');</span><br><span class="line"></span><br><span class="line">                    WHILE (l_row IS NOT NULL)</span><br><span class="line">                    LOOP</span><br><span class="line">                        add_to_context (</span><br><span class="line">                               l_contexts (l_row).name</span><br><span class="line">                            || ' = '</span><br><span class="line">                            || l_contexts (l_row).VALUE);</span><br><span class="line">                        l_row := l_contexts.NEXT (l_row);</span><br><span class="line">                    <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">            <span class="comment">--1.0.4 If string gets too big then just pass back what we've got.</span></span><br><span class="line">            EXCEPTION</span><br><span class="line">                WHEN VALUE_ERROR</span><br><span class="line">                THEN</span><br><span class="line">                    NULL;</span><br><span class="line">            <span class="keyword">END</span> add_remaining_contexts;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            error_info_out.text := l_error_instance.MESSAGE;</span><br><span class="line"></span><br><span class="line">            <span class="comment">-- Use context values for substitution, then add any contexts</span></span><br><span class="line">            <span class="comment">-- that were not used at the end of the string.</span></span><br><span class="line">            <span class="keyword">SELECT</span> *</span><br><span class="line">              <span class="keyword">BULK</span> <span class="keyword">COLLECT</span> <span class="keyword">INTO</span> l_contexts</span><br><span class="line">              <span class="keyword">FROM</span> q$error_context</span><br><span class="line">             <span class="keyword">WHERE</span> error_instance_id = l_error_instance.id;</span><br><span class="line"></span><br><span class="line">            substitute_strings (l_error.substitute_string</span><br><span class="line">                               ,l_error.recommendation</span><br><span class="line">                               ,l_contexts);</span><br><span class="line">            error_info_out.recommendation := l_error.recommendation;</span><br><span class="line"></span><br><span class="line">            IF error_info_out.text IS NULL</span><br><span class="line">               AND l_error.substitute_string IS NULL</span><br><span class="line">            THEN</span><br><span class="line">                <span class="comment">-- Fall back on the generic descriptoin.</span></span><br><span class="line">                error_info_out.text := l_error.description;</span><br><span class="line">            ELSE</span><br><span class="line">                add_to_text (l_error.substitute_string);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            add_remaining_contexts;</span><br><span class="line"></span><br><span class="line">            <span class="comment">/* 1.4.0 option to disgard the remaining_context in the text*/</span></span><br><span class="line">            IF add_remaining_context_enabled ()</span><br><span class="line">            THEN</span><br><span class="line">                <span class="keyword">BEGIN</span></span><br><span class="line">                    add_to_text (error_info_out.contexts);</span><br><span class="line">                EXCEPTION</span><br><span class="line">                    WHEN VALUE_ERROR</span><br><span class="line">                    THEN</span><br><span class="line">                        add_to_text (</span><br><span class="line">                            SUBSTR (</span><br><span class="line">                                error_info_out.contexts</span><br><span class="line">                               ,1</span><br><span class="line">                               ,  c_varchar2_max_length</span><br><span class="line">                                - LENGTH (error_info_out.text)</span><br><span class="line">                                - 2));</span><br><span class="line">                <span class="keyword">END</span>;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> subst_for_msg_help_strings;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> error_instance_id_in <span class="keyword">IS</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="comment">-- Fall back on current error information.</span></span><br><span class="line">            error_info_out.code := <span class="keyword">SQLCODE</span>;</span><br><span class="line">            error_info_out.name := 'Oracle Error';</span><br><span class="line">            error_info_out.system_error_code := SQLCODE;</span><br><span class="line">            error_info_out.system_error_message :=</span><br><span class="line">                DBMS_UTILITY.format_error_stack;</span><br><span class="line">            error_info_out.text := DBMS_UTILITY.format_error_stack;</span><br><span class="line">        ELSE</span><br><span class="line">            l_error_instance :=</span><br><span class="line">                q$error_instance_qp_onerow (error_instance_id_in);</span><br><span class="line">            l_error := q$error_qp_onerow (l_error_instance.error_id);</span><br><span class="line">            <span class="comment">--</span></span><br><span class="line">            error_info_out.code := l_error.code;</span><br><span class="line">            error_info_out.name := l_error.name;</span><br><span class="line">            <span class="comment">/* 1.4.0 */</span></span><br><span class="line">            error_info_out.error_category_name := l_error.error_category_name;</span><br><span class="line">            <span class="comment">--</span></span><br><span class="line">            subst_for_msg_help_strings;</span><br><span class="line">            error_info_out.system_error_code :=</span><br><span class="line">                l_error_instance.system_error_code;</span><br><span class="line">            error_info_out.system_error_message :=</span><br><span class="line">                l_error_instance.system_error_message;</span><br><span class="line">            error_info_out.call_stack := l_error_instance.call_stack;</span><br><span class="line">            <span class="comment">/* 1.3.1 If an assertion, then error stack is empty. */</span></span><br><span class="line">            error_info_out.error_stack :=</span><br><span class="line">                NVL (l_error_instance.error_stack</span><br><span class="line">                    ,l_error_instance.call_stack);</span><br><span class="line">            error_info_out.environment_info :=</span><br><span class="line">                l_error_instance.environment_info;</span><br><span class="line"></span><br><span class="line">            <span class="comment">/* 1.3 Add id and message, also environment info. */</span></span><br><span class="line">            error_info_out.id := l_error_instance.id;</span><br><span class="line">            error_info_out.error_id := l_error_instance.error_id;</span><br><span class="line">            error_info_out.created_on := l_error_instance.created_on;</span><br><span class="line">            error_info_out.created_by := l_error_instance.created_by;</span><br><span class="line">            error_info_out.changed_on := l_error_instance.changed_on;</span><br><span class="line">            error_info_out.changed_by := l_error_instance.changed_by;</span><br><span class="line">            error_info_out.MESSAGE := l_error_instance.MESSAGE;</span><br><span class="line"></span><br><span class="line">            <span class="comment">-- All done, revert to "no error" state.</span></span><br><span class="line">            mark_q$error_handled;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (error_info_out OUT error_info_rt)</span><br><span class="line">    IS</span><br><span class="line">        l_message             maxvarchar2_t := DBMS_UTILITY.format_error_stack;</span><br><span class="line">        l_extra               q$error.description%TYPE;</span><br><span class="line">        l_error_instance_id   q$error_instance.id%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        parse_message (l_message, l_error_instance_id, l_extra);</span><br><span class="line"></span><br><span class="line">        IF l_error_instance_id IS NOT NULL</span><br><span class="line">        THEN</span><br><span class="line">            get_error_info (error_instance_id_in   =&gt; l_error_instance_id</span><br><span class="line">                           ,error_info_out         =&gt; error_info_out);</span><br><span class="line">        ELSE</span><br><span class="line">            <span class="comment">-- Of the form ORA-NNNNN: Message</span></span><br><span class="line">            error_info_out.code :=</span><br><span class="line">                SUBSTR (l_message, 4, INSTR (l_message, ':') - 4);</span><br><span class="line">            error_info_out.name := 'System Error';</span><br><span class="line">            error_info_out.text := l_message;</span><br><span class="line">            error_info_out.system_error_code := error_info_out.code;</span><br><span class="line">            error_info_out.system_error_message := error_info_out.text;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">-- All done, revert to "no error" state.</span></span><br><span class="line">        mark_q$error_handled;</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_info</span><br><span class="line">        RETURN error_info_rt</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error;</span><br><span class="line">    <span class="keyword">END</span> last_error_info;</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in       IN     q$error_instance.id%TYPE</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline)</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_instance_id_in   =&gt; error_instance_id_in</span><br><span class="line">                       ,error_info_out         =&gt; l_error</span><br><span class="line">                       ,context_delimiter_in   =&gt; context_delimiter_in);</span><br><span class="line">        <span class="comment">--</span></span><br><span class="line">        <span class="comment">-- All this logic repeated in next overloading!</span></span><br><span class="line">        code_out := l_error.code;</span><br><span class="line">        name_out := l_error.name;</span><br><span class="line">        text_out := l_error.text;</span><br><span class="line">        recommendation_out := l_error.recommendation;</span><br><span class="line">        system_error_code_out := l_error.system_error_code;</span><br><span class="line">        system_error_message_out := l_error.system_error_message;</span><br><span class="line">        error_stack_out := l_error.error_stack;</span><br><span class="line">        call_stack_out := l_error.call_stack;</span><br><span class="line">        environment_info_out := l_error.environment_info;</span><br><span class="line">        contexts_out := l_error.contexts;</span><br><span class="line">        id_out := l_error.id;</span><br><span class="line">        message_out := l_error.MESSAGE;</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_id</span><br><span class="line">        RETURN q$error.id%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.error_id;</span><br><span class="line">    <span class="keyword">END</span> last_error_id;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_instance_id</span><br><span class="line">        RETURN q$error_instance.id%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.id;</span><br><span class="line">    <span class="keyword">END</span> last_instance_id;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.4.0 */</span></span><br><span class="line">    FUNCTION last_error_category_name</span><br><span class="line">        RETURN q$error.error_category_name%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.error_category_name;</span><br><span class="line">    <span class="keyword">END</span> last_error_category_name;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_code</span><br><span class="line">        RETURN q$error.code%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.code;</span><br><span class="line">    <span class="keyword">END</span> last_code;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_name</span><br><span class="line">        RETURN q$error.name%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.name;</span><br><span class="line">    <span class="keyword">END</span> last_name;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_text</span><br><span class="line">        RETURN q$error_instance.MESSAGE%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.text;</span><br><span class="line">    <span class="keyword">END</span> last_text;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_system_error_code</span><br><span class="line">        RETURN q$error_instance.system_error_code%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.system_error_code;</span><br><span class="line">    <span class="keyword">END</span> last_system_error_code;</span><br><span class="line"></span><br><span class="line">    FUNCTION last_system_error_message</span><br><span class="line">        RETURN q$error_instance.system_error_message%TYPE</span><br><span class="line">    IS</span><br><span class="line">        l_error   error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (l_error);</span><br><span class="line">        RETURN l_error.system_error_message;</span><br><span class="line">    <span class="keyword">END</span> last_system_error_message;</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_instance_id_in       IN     q$error_instance.id%TYPE</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE)</span><br><span class="line">    IS</span><br><span class="line">        l_id         q$error_instance.id%TYPE;</span><br><span class="line">        l_message    q$error_instance.MESSAGE%TYPE;</span><br><span class="line">        l_contexts   maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_instance_id_in       =&gt; error_instance_id_in</span><br><span class="line">                       ,code_out                   =&gt; code_out</span><br><span class="line">                       ,name_out                   =&gt; name_out</span><br><span class="line">                       ,text_out                   =&gt; text_out</span><br><span class="line">                       ,system_error_code_out      =&gt; system_error_code_out</span><br><span class="line">                       ,system_error_message_out   =&gt; system_error_message_out</span><br><span class="line">                       ,recommendation_out         =&gt; recommendation_out</span><br><span class="line">                       ,error_stack_out            =&gt; error_stack_out</span><br><span class="line">                       ,call_stack_out             =&gt; call_stack_out</span><br><span class="line">                       ,environment_info_out       =&gt; environment_info_out</span><br><span class="line">                       ,id_out                     =&gt; l_id</span><br><span class="line">                       ,message_out                =&gt; l_message</span><br><span class="line">                       ,contexts_out               =&gt; l_contexts);</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_message_in           IN     VARCHAR2</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline)</span><br><span class="line">    IS</span><br><span class="line">        l_error               error_info_rt;</span><br><span class="line">        l_extra               q$error.description%TYPE;</span><br><span class="line">        l_error_instance_id   q$error_instance.id%TYPE;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        parse_message (error_message_in, l_error_instance_id, l_extra);</span><br><span class="line"></span><br><span class="line">        IF l_error_instance_id IS NOT NULL</span><br><span class="line">        THEN</span><br><span class="line">            get_error_info (error_instance_id_in   =&gt; l_error_instance_id</span><br><span class="line">                           ,error_info_out         =&gt; l_error</span><br><span class="line">                           ,context_delimiter_in   =&gt; context_delimiter_in);</span><br><span class="line">            code_out := l_error.code;</span><br><span class="line">            name_out := l_error.name;</span><br><span class="line">            text_out := l_error.text;</span><br><span class="line">            recommendation_out := l_error.recommendation;</span><br><span class="line">            system_error_code_out := l_error.system_error_code;</span><br><span class="line">            system_error_message_out := l_error.system_error_message;</span><br><span class="line">            error_stack_out := l_error.error_stack;</span><br><span class="line">            call_stack_out := l_error.call_stack;</span><br><span class="line">            id_out := l_error.id;</span><br><span class="line">            message_out := error_message_in;</span><br><span class="line">            environment_info_out := l_error.environment_info;</span><br><span class="line">            contexts_out := l_error.contexts;</span><br><span class="line">        ELSE</span><br><span class="line">            <span class="comment">-- Of the form ORA-NNNNN: Message</span></span><br><span class="line">            code_out :=</span><br><span class="line">                SUBSTR (error_message_in</span><br><span class="line">                       ,4</span><br><span class="line">                       ,INSTR (error_message_in, ':') - 4);</span><br><span class="line">            name_out := 'System Error';</span><br><span class="line">            text_out := error_message_in;</span><br><span class="line">            system_error_code_out := code_out;</span><br><span class="line">            system_error_message_out := text_out;</span><br><span class="line">            id_out := NULL;</span><br><span class="line">            message_out := error_message_in;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">-- All done, revert to "no error" state.</span></span><br><span class="line">        mark_q$error_handled;</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3.6 Standardize arg name */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        error_message_in           IN     VARCHAR2</span><br><span class="line">       ,code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE)</span><br><span class="line">    IS</span><br><span class="line">        l_id         q$error_instance.id%TYPE;</span><br><span class="line">        l_message    q$error_instance.MESSAGE%TYPE;</span><br><span class="line">        l_contexts   maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_message_in           =&gt; DBMS_UTILITY.format_error_stack</span><br><span class="line">                       ,code_out                   =&gt; code_out</span><br><span class="line">                       ,name_out                   =&gt; name_out</span><br><span class="line">                       ,text_out                   =&gt; text_out</span><br><span class="line">                       ,system_error_code_out      =&gt; system_error_code_out</span><br><span class="line">                       ,system_error_message_out   =&gt; system_error_message_out</span><br><span class="line">                       ,recommendation_out         =&gt; recommendation_out</span><br><span class="line">                       ,error_stack_out            =&gt; error_stack_out</span><br><span class="line">                       ,call_stack_out             =&gt; call_stack_out</span><br><span class="line">                       ,environment_info_out       =&gt; environment_info_out</span><br><span class="line">                       ,id_out                     =&gt; l_id</span><br><span class="line">                       ,message_out                =&gt; l_message</span><br><span class="line">                       ,contexts_out               =&gt; l_contexts);</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        code_out                   OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                   OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out      OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out   OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out         OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out            OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out             OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out       OUT q$error_instance.environment_info%TYPE)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_message_in           =&gt; DBMS_UTILITY.format_error_stack</span><br><span class="line">                       ,code_out                   =&gt; code_out</span><br><span class="line">                       ,name_out                   =&gt; name_out</span><br><span class="line">                       ,text_out                   =&gt; text_out</span><br><span class="line">                       ,system_error_code_out      =&gt; system_error_code_out</span><br><span class="line">                       ,system_error_message_out   =&gt; system_error_message_out</span><br><span class="line">                       ,recommendation_out         =&gt; recommendation_out</span><br><span class="line">                       ,error_stack_out            =&gt; error_stack_out</span><br><span class="line">                       ,call_stack_out             =&gt; call_stack_out</span><br><span class="line">                       ,environment_info_out       =&gt; environment_info_out);</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/* 1.3 Add id and message as OUT arguments */</span></span><br><span class="line">    PROCEDURE get_error_info (</span><br><span class="line">        code_out                      OUT q$error.code%TYPE</span><br><span class="line">       ,name_out                      OUT q$error.name%TYPE</span><br><span class="line">       ,text_out                      OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,system_error_code_out         OUT q$error_instance.system_error_code%TYPE</span><br><span class="line">       ,system_error_message_out      OUT q$error_instance.system_error_message%TYPE</span><br><span class="line">       ,recommendation_out            OUT q$error.recommendation%TYPE</span><br><span class="line">       ,error_stack_out               OUT q$error_instance.error_stack%TYPE</span><br><span class="line">       ,call_stack_out                OUT q$error_instance.call_stack%TYPE</span><br><span class="line">       ,environment_info_out          OUT q$error_instance.environment_info%TYPE</span><br><span class="line">       ,id_out                        OUT q$error_instance.id%TYPE</span><br><span class="line">       ,message_out                   OUT q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,contexts_out                  OUT VARCHAR2</span><br><span class="line">       ,context_delimiter_in       IN     VARCHAR2 DEFAULT c_newline)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_message_in           =&gt; DBMS_UTILITY.format_error_stack</span><br><span class="line">                       ,code_out                   =&gt; code_out</span><br><span class="line">                       ,name_out                   =&gt; name_out</span><br><span class="line">                       ,text_out                   =&gt; text_out</span><br><span class="line">                       ,system_error_code_out      =&gt; system_error_code_out</span><br><span class="line">                       ,system_error_message_out   =&gt; system_error_message_out</span><br><span class="line">                       ,recommendation_out         =&gt; recommendation_out</span><br><span class="line">                       ,error_stack_out            =&gt; error_stack_out</span><br><span class="line">                       ,call_stack_out             =&gt; call_stack_out</span><br><span class="line">                       ,environment_info_out       =&gt; environment_info_out</span><br><span class="line">                       ,id_out                     =&gt; id_out</span><br><span class="line">                       ,message_out                =&gt; message_out</span><br><span class="line">                       ,context_delimiter_in       =&gt; context_delimiter_in</span><br><span class="line">                       ,contexts_out               =&gt; contexts_out);</span><br><span class="line">    <span class="keyword">END</span> get_error_info;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- 1.2 Get message text only</span></span><br><span class="line">    FUNCTION error_message</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        l_extra               q$error.description%TYPE;</span><br><span class="line">        l_error_instance_id   q$error_instance.id%TYPE;</span><br><span class="line">        l_error               error_info_rt;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        parse_message (DBMS_UTILITY.format_error_stack</span><br><span class="line">                      ,l_error_instance_id</span><br><span class="line">                      ,l_extra);</span><br><span class="line">        get_error_info (error_instance_id_in   =&gt; l_error_instance_id</span><br><span class="line">                       ,error_info_out         =&gt; l_error);</span><br><span class="line">        RETURN NVL (l_error.text, l_error.system_error_message);</span><br><span class="line">    <span class="keyword">END</span> error_message;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_clipboard (clear_clipboard_in IN BOOLEAN DEFAULT TRUE)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">        l_clipboard   maxvarchar2_t;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        l_clipboard := g_clipboard;</span><br><span class="line"></span><br><span class="line">        IF clear_clipboard_in</span><br><span class="line">        THEN</span><br><span class="line">            clear_error_clipboard;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        RETURN l_clipboard;</span><br><span class="line">    <span class="keyword">END</span> error_clipboard;</span><br><span class="line"></span><br><span class="line">    FUNCTION error_clipboard_is_full</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> g_clipboard_is_full;</span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">     IF g_clipboard IS NULL</span></span><br><span class="line"><span class="comment">    THEN</span></span><br><span class="line"><span class="comment">     RETURN FALSE;</span></span><br><span class="line"><span class="comment">    ELSE</span></span><br><span class="line"><span class="comment">     RETURN (c_warning LIKE g_clipboard || '%');</span></span><br><span class="line"><span class="comment">    END IF;</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="keyword">END</span> error_clipboard_is_full;</span><br><span class="line"></span><br><span class="line">    PROCEDURE clear_error_clipboard</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        g_clipboard := <span class="literal">NULL</span>;</span><br><span class="line">        g_clipboard_is_full := FALSE;</span><br><span class="line">    <span class="keyword">END</span> clear_error_clipboard;</span><br><span class="line"></span><br><span class="line">    PROCEDURE add_to_error_clipboard (str IN VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> g_clipboard <span class="keyword">IS</span> <span class="literal">NULL</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            g_clipboard := <span class="keyword">str</span>;</span><br><span class="line">        ELSE</span><br><span class="line">            g_clipboard := g_clipboard || CHR (10) || str;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> add_to_error_clipboard;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_error_info (</span><br><span class="line">        error_instance_id_in   IN q$error_instance.id%TYPE</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        code_out                   q$error.code%TYPE;</span><br><span class="line">        name_out                   q$error.name%TYPE;</span><br><span class="line">        text_out                   q$error_instance.MESSAGE%TYPE;</span><br><span class="line">        system_error_code_out      q$error_instance.system_error_code%TYPE;</span><br><span class="line">        system_error_message_out   q$error_instance.system_error_message%TYPE;</span><br><span class="line">        recommendation_out         q$error.recommendation%TYPE;</span><br><span class="line">        error_stack_out            q$error_instance.error_stack%TYPE;</span><br><span class="line">        call_stack_out             q$error_instance.call_stack%TYPE;</span><br><span class="line">        environment_info_out       q$error_instance.environment_info%TYPE;</span><br><span class="line"></span><br><span class="line">        PROCEDURE pl (str IN VARCHAR2)</span><br><span class="line">        IS</span><br><span class="line">            already_full   EXCEPTION;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            <span class="keyword">IF</span> error_clipboard_is_full</span><br><span class="line">            <span class="keyword">THEN</span></span><br><span class="line">                <span class="keyword">RAISE</span> already_full;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">            IF copy_to_clipboard_in</span><br><span class="line">            THEN</span><br><span class="line">                add_to_error_clipboard (str);</span><br><span class="line">            ELSE</span><br><span class="line">                q$error_manager.pl (str);</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        EXCEPTION</span><br><span class="line">            WHEN already_full</span><br><span class="line">            THEN</span><br><span class="line">                NULL;</span><br><span class="line">            WHEN VALUE_ERROR</span><br><span class="line">            THEN</span><br><span class="line">                g_clipboard_is_full := TRUE;</span><br><span class="line"></span><br><span class="line">                IF LENGTH (g_clipboard) &gt;</span><br><span class="line">                       (c_varchar2_max_length - c_warning_len)</span><br><span class="line">                THEN</span><br><span class="line">                    g_clipboard :=</span><br><span class="line">                        c_trunc_warning</span><br><span class="line">                        || SUBSTR (g_clipboard</span><br><span class="line">                                  ,1</span><br><span class="line">                                  ,c_varchar2_max_length - c_warning_len);</span><br><span class="line">                ELSE</span><br><span class="line">                    g_clipboard := c_trunc_warning || g_clipboard;</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> pl;</span><br><span class="line"></span><br><span class="line">        PROCEDURE pl_header (str IN VARCHAR2)</span><br><span class="line">        IS</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            pl (<span class="string">'================================================='</span>);</span><br><span class="line">            pl (str);</span><br><span class="line">        <span class="keyword">END</span> pl_header;</span><br><span class="line"></span><br><span class="line">        PROCEDURE show_contexts</span><br><span class="line">        IS</span><br><span class="line">            l_context   q$error_context_tc;</span><br><span class="line">            l_row       PLS_INTEGER;</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            <span class="keyword">SELECT</span> *</span><br><span class="line">              <span class="keyword">BULK</span> <span class="keyword">COLLECT</span> <span class="keyword">INTO</span> l_context</span><br><span class="line">              <span class="keyword">FROM</span> q$error_context</span><br><span class="line">             <span class="keyword">WHERE</span> error_instance_id = error_instance_id_in;</span><br><span class="line"></span><br><span class="line">            l_row := l_context.FIRST;</span><br><span class="line"></span><br><span class="line">            IF l_row IS NOT NULL</span><br><span class="line">            THEN</span><br><span class="line">                pl ('   &gt; Error context information:');</span><br><span class="line"></span><br><span class="line">                WHILE (l_row IS NOT NULL)</span><br><span class="line">                LOOP</span><br><span class="line">                    pl ('      Context = "' || l_context (l_row).name || '"');</span><br><span class="line">                    pl ('      Value = "' || l_context (l_row).VALUE || '"');</span><br><span class="line">                    l_row := l_context.NEXT (l_row);</span><br><span class="line">                <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">            <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">        <span class="keyword">END</span> show_contexts;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        get_error_info (error_instance_id_in       =&gt; error_instance_id_in</span><br><span class="line">                       ,code_out                   =&gt; code_out</span><br><span class="line">                       ,name_out                   =&gt; name_out</span><br><span class="line">                       ,text_out                   =&gt; text_out</span><br><span class="line">                       ,system_error_code_out      =&gt; system_error_code_out</span><br><span class="line">                       ,system_error_message_out   =&gt; system_error_message_out</span><br><span class="line">                       ,recommendation_out         =&gt; recommendation_out</span><br><span class="line">                       ,error_stack_out            =&gt; error_stack_out</span><br><span class="line">                       ,call_stack_out             =&gt; call_stack_out</span><br><span class="line">                       ,environment_info_out       =&gt; environment_info_out);</span><br><span class="line">        pl_header (</span><br><span class="line">            'Error report for error instance ' || error_instance_id_in);</span><br><span class="line">        pl ('   &gt; Code-Name: ' || code_out || '-' || name_out);</span><br><span class="line">        pl ('   &gt; Text: ' || text_out);</span><br><span class="line">        pl ('   &gt; System error code: ' || system_error_code_out);</span><br><span class="line">        pl ('   &gt; System error message: ' || system_error_message_out);</span><br><span class="line">        pl ('   &gt; Recommendation: ' || recommendation_out);</span><br><span class="line">        pl ('   &gt; Error stack: ' || error_stack_out);</span><br><span class="line">        pl ('   &gt; Call stack: ' || call_stack_out);</span><br><span class="line"></span><br><span class="line">        IF environment_info_out IS NOT NULL</span><br><span class="line">        THEN</span><br><span class="line">            pl_header ('   &gt; Environmental Information');</span><br><span class="line">            pl ('   ' || environment_info_out);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        show_contexts;</span><br><span class="line">    <span class="keyword">END</span> show_error_info;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors (cursor_in              IN weak_refcursor</span><br><span class="line">                          ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        l_error_id   PLS_INTEGER;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">LOOP</span></span><br><span class="line">            <span class="keyword">FETCH</span> cursor_in <span class="keyword">INTO</span> l_error_id;</span><br><span class="line"></span><br><span class="line">            EXIT WHEN cursor_in%NOTFOUND;</span><br><span class="line">            show_error_info (l_error_id</span><br><span class="line">                            ,copy_to_clipboard_in   =&gt; copy_to_clipboard_in);</span><br><span class="line">            EXIT WHEN error_clipboard_is_full;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">LOOP</span>;</span><br><span class="line">    <span class="keyword">END</span> show_errors;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_after (</span><br><span class="line">        date_in                IN DATE</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        l_cursor   weak_refcursor;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">OPEN</span> l_cursor <span class="keyword">FOR</span></span><br><span class="line">            <span class="keyword">SELECT</span> <span class="keyword">id</span></span><br><span class="line">              <span class="keyword">FROM</span> q$error_instance</span><br><span class="line">             <span class="keyword">WHERE</span> created_on &gt;= date_in</span><br><span class="line">            <span class="keyword">ORDER</span> <span class="keyword">BY</span> <span class="keyword">id</span>;</span><br><span class="line"></span><br><span class="line">        show_errors (l_cursor, copy_to_clipboard_in =&gt; copy_to_clipboard_in);</span><br><span class="line"></span><br><span class="line">        CLOSE l_cursor;</span><br><span class="line">    <span class="keyword">END</span> show_errors_after;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_with_message (</span><br><span class="line">        text_in                IN VARCHAR2</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        l_cursor   weak_refcursor;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">OPEN</span> l_cursor <span class="keyword">FOR</span></span><br><span class="line">            <span class="keyword">SELECT</span> <span class="keyword">id</span></span><br><span class="line">              <span class="keyword">FROM</span> q$error_instance</span><br><span class="line">             <span class="keyword">WHERE</span> <span class="keyword">INSTR</span> (<span class="keyword">UPPER</span> (MESSAGE), <span class="keyword">UPPER</span> (text_in)) &gt; <span class="number">0</span></span><br><span class="line">            <span class="keyword">ORDER</span> <span class="keyword">BY</span> <span class="keyword">id</span>;</span><br><span class="line"></span><br><span class="line">        show_errors (l_cursor, copy_to_clipboard_in =&gt; copy_to_clipboard_in);</span><br><span class="line"></span><br><span class="line">        CLOSE l_cursor;</span><br><span class="line">    <span class="keyword">END</span> show_errors_with_message;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_with_code (</span><br><span class="line">        error_code_in             IN PLS_INTEGER</span><br><span class="line">       ,is_system_error_code_in   IN BOOLEAN DEFAULT FALSE</span><br><span class="line">       ,copy_to_clipboard_in      IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        l_cursor   weak_refcursor;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> is_system_error_code_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">OPEN</span> l_cursor <span class="keyword">FOR</span></span><br><span class="line">                <span class="keyword">SELECT</span> <span class="keyword">id</span></span><br><span class="line">                  <span class="keyword">FROM</span> q$error_instance</span><br><span class="line">                 <span class="keyword">WHERE</span> system_error_code = error_code_in</span><br><span class="line">                <span class="keyword">ORDER</span> <span class="keyword">BY</span> <span class="keyword">id</span>;</span><br><span class="line">        ELSE</span><br><span class="line">            OPEN l_cursor FOR</span><br><span class="line">                <span class="keyword">SELECT</span> i.id</span><br><span class="line">                  <span class="keyword">FROM</span> q$error_instance i, q$<span class="keyword">error</span> e</span><br><span class="line">                 <span class="keyword">WHERE</span> i.error_id = e.id <span class="keyword">AND</span> code = error_code_in</span><br><span class="line">                <span class="keyword">ORDER</span> <span class="keyword">BY</span> i.id;</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        show_errors (l_cursor, copy_to_clipboard_in =&gt; copy_to_clipboard_in);</span><br><span class="line"></span><br><span class="line">        CLOSE l_cursor;</span><br><span class="line">    <span class="keyword">END</span> show_errors_with_code;</span><br><span class="line"></span><br><span class="line">    PROCEDURE show_errors_for (</span><br><span class="line">        where_clause_in        IN VARCHAR2</span><br><span class="line">       ,copy_to_clipboard_in   IN BOOLEAN DEFAULT FALSE)</span><br><span class="line">    IS</span><br><span class="line">        l_cursor   weak_refcursor;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">OPEN</span> l_cursor <span class="keyword">FOR</span></span><br><span class="line">               <span class="string">'SELECT ID FROM q$error_instance WHERE '</span></span><br><span class="line">            || where_clause_in</span><br><span class="line">            || <span class="string">' ORDER BY ID'</span>;</span><br><span class="line"></span><br><span class="line">        show_errors (l_cursor, copy_to_clipboard_in =&gt; copy_to_clipboard_in);</span><br><span class="line"></span><br><span class="line">        CLOSE l_cursor;</span><br><span class="line">    <span class="keyword">END</span> show_errors_for;</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in    IN BOOLEAN</span><br><span class="line">                     ,text_in         IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,error_code_in   IN q$error.code%TYPE</span><br><span class="line">                     ,name1_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in       IN VARCHAR2 DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> condition_in <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">OR</span> <span class="keyword">NOT</span> condition_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (<span class="string">'ASSERTION FAILURE'</span>, text_in, <span class="literal">FALSE</span>);</span><br><span class="line">            raise_error (error_code_in      =&gt; error_code_in</span><br><span class="line">                        ,text_in            =&gt; text_in</span><br><span class="line">                        ,name1_in           =&gt; name1_in</span><br><span class="line">                        ,value1_in          =&gt; value1_in</span><br><span class="line">                        ,name2_in           =&gt; name2_in</span><br><span class="line">                        ,value2_in          =&gt; value2_in</span><br><span class="line">                        ,name3_in           =&gt; name3_in</span><br><span class="line">                        ,value3_in          =&gt; value3_in</span><br><span class="line">                        ,name4_in           =&gt; name4_in</span><br><span class="line">                        ,value4_in          =&gt; value4_in</span><br><span class="line">                        ,name5_in           =&gt; name5_in</span><br><span class="line">                        ,value5_in          =&gt; value5_in</span><br><span class="line">                        ,grab_settings_in   =&gt; TRUE);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> assert;</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in    IN BOOLEAN</span><br><span class="line">                     ,text_in         IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,error_name_in   IN q$error.name%TYPE</span><br><span class="line">                     ,name1_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in        IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in       IN VARCHAR2 DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> condition_in <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">OR</span> <span class="keyword">NOT</span> condition_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (<span class="string">'ASSERT'</span>, text_in, <span class="literal">TRUE</span>);</span><br><span class="line">            raise_error (error_name_in      =&gt; error_name_in</span><br><span class="line">                        ,text_in            =&gt; text_in</span><br><span class="line">                        ,name1_in           =&gt; name1_in</span><br><span class="line">                        ,value1_in          =&gt; value1_in</span><br><span class="line">                        ,name2_in           =&gt; name2_in</span><br><span class="line">                        ,value2_in          =&gt; value2_in</span><br><span class="line">                        ,name3_in           =&gt; name3_in</span><br><span class="line">                        ,value3_in          =&gt; value3_in</span><br><span class="line">                        ,name4_in           =&gt; name4_in</span><br><span class="line">                        ,value4_in          =&gt; value4_in</span><br><span class="line">                        ,name5_in           =&gt; name5_in</span><br><span class="line">                        ,value5_in          =&gt; value5_in</span><br><span class="line">                        ,grab_settings_in   =&gt; TRUE);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> assert;</span><br><span class="line"></span><br><span class="line">    PROCEDURE assert (condition_in   IN BOOLEAN</span><br><span class="line">                     ,text_in        IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">                     ,name1_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value1_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name2_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value2_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name3_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value3_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name4_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value4_in      IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,name5_in       IN VARCHAR2 DEFAULT NULL</span><br><span class="line">                     ,value5_in      IN VARCHAR2 DEFAULT NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> condition_in <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">OR</span> <span class="keyword">NOT</span> condition_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (<span class="string">'ASSERT'</span>, text_in, <span class="literal">TRUE</span>);</span><br><span class="line">            raise_error (error_name_in      =&gt; 'ASSERTION-FAILURE'</span><br><span class="line">                        ,text_in            =&gt; text_in</span><br><span class="line">                        ,name1_in           =&gt; name1_in</span><br><span class="line">                        ,value1_in          =&gt; value1_in</span><br><span class="line">                        ,name2_in           =&gt; name2_in</span><br><span class="line">                        ,value2_in          =&gt; value2_in</span><br><span class="line">                        ,name3_in           =&gt; name3_in</span><br><span class="line">                        ,value3_in          =&gt; value3_in</span><br><span class="line">                        ,name4_in           =&gt; name4_in</span><br><span class="line">                        ,value4_in          =&gt; value4_in</span><br><span class="line">                        ,name5_in           =&gt; name5_in</span><br><span class="line">                        ,value5_in          =&gt; value5_in</span><br><span class="line">                        ,grab_settings_in   =&gt; TRUE);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> assert;</span><br><span class="line"></span><br><span class="line">    PROCEDURE simple_assert (</span><br><span class="line">        condition_in         IN BOOLEAN</span><br><span class="line">       ,text_in              IN q$error_instance.MESSAGE%TYPE</span><br><span class="line">       ,name1_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value1_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name2_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value2_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name3_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value3_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name4_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value4_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,name5_in             IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,value5_in            IN VARCHAR2 DEFAULT NULL</span><br><span class="line">       ,raise_with_code_in   IN PLS_INTEGER DEFAULT -20000)</span><br><span class="line">    IS</span><br><span class="line">        l_text   maxvarchar2_t := text_in;</span><br><span class="line"></span><br><span class="line">        PROCEDURE add_nv (text_inout   IN OUT VARCHAR2</span><br><span class="line">                         ,nm_in        IN     VARCHAR2</span><br><span class="line">                         ,val_in       IN     VARCHAR2)</span><br><span class="line">        IS</span><br><span class="line">        <span class="keyword">BEGIN</span></span><br><span class="line">            text_inout :=</span><br><span class="line">                text_inout</span><br><span class="line">                || <span class="keyword">CASE</span></span><br><span class="line">                       <span class="keyword">WHEN</span> nm_in <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">THEN</span> <span class="literal">NULL</span></span><br><span class="line">                       <span class="keyword">ELSE</span> <span class="keyword">CHR</span> (<span class="number">10</span>) || nm_in || <span class="string">' = '</span> || val_in</span><br><span class="line">                   <span class="keyword">END</span>;</span><br><span class="line">        <span class="keyword">END</span> add_nv;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> condition_in <span class="keyword">IS</span> <span class="literal">NULL</span> <span class="keyword">OR</span> <span class="keyword">NOT</span> condition_in</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            add_nv (l_text, name1_in, value1_in);</span><br><span class="line">            add_nv (l_text, name2_in, value2_in);</span><br><span class="line">            add_nv (l_text, name3_in, value3_in);</span><br><span class="line">            add_nv (l_text, name4_in, value4_in);</span><br><span class="line">            add_nv (l_text, name5_in, value5_in);</span><br><span class="line"></span><br><span class="line">            raise_application_error (raise_with_code_in, l_text);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> simple_assert;</span><br><span class="line"></span><br><span class="line">    PROCEDURE start_execution (program_name_in   IN VARCHAR2 := NULL</span><br><span class="line">                              ,information_in    IN VARCHAR2 := NULL)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="literal">NULL</span>;</span><br><span class="line">    <span class="keyword">END</span> start_execution;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">    Test builder validation:</span></span><br><span class="line"><span class="comment">     * return a status string composed of type:message</span></span><br><span class="line"><span class="comment">     * if no prefix, then it is an error</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    FUNCTION is_warning (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> status_in <span class="keyword">LIKE</span> c_warning || <span class="string">'%'</span>;</span><br><span class="line">    <span class="keyword">END</span> is_warning;</span><br><span class="line"></span><br><span class="line">    FUNCTION is_error (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> status_in <span class="keyword">LIKE</span> c_error || <span class="string">'%'</span>;</span><br><span class="line">    <span class="keyword">END</span> is_error;</span><br><span class="line"></span><br><span class="line">    FUNCTION is_info_msg (status_in IN VARCHAR2)</span><br><span class="line">        RETURN BOOLEAN</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> status_in <span class="keyword">LIKE</span> c_info_msg || <span class="string">'%'</span>;</span><br><span class="line">    <span class="keyword">END</span> is_info_msg;</span><br><span class="line"></span><br><span class="line">    PROCEDURE parse_status_string (status_in         IN     VARCHAR2</span><br><span class="line">                                  ,status_type_out      OUT VARCHAR2</span><br><span class="line">                                  ,message_out          OUT VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">        l_loc   PLS_INTEGER := INSTR (status_in, c_status_delimiter);</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> l_loc = <span class="number">0</span></span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            status_type_out := c_error;</span><br><span class="line">            message_out := status_in;</span><br><span class="line">        ELSE</span><br><span class="line">            status_type_out := SUBSTR (status_in, 1, l_loc - 1);</span><br><span class="line">            message_out := SUBSTR (status_in, l_loc + 1);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line">    <span class="keyword">END</span> parse_status_string;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_a_string (header_in IN VARCHAR2, status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> header_in || c_status_delimiter || status_in</span><br><span class="line">               || <span class="keyword">CASE</span></span><br><span class="line">                      <span class="keyword">WHEN</span> trace_enabled</span><br><span class="line">                      <span class="keyword">THEN</span></span><br><span class="line">                          <span class="keyword">CHR</span> (<span class="number">10</span>) || <span class="keyword">CHR</span> (<span class="number">10</span>) || error_backtrace</span><br><span class="line">                      <span class="keyword">ELSE</span></span><br><span class="line">                          <span class="literal">NULL</span></span><br><span class="line">                  <span class="keyword">END</span>;</span><br><span class="line">    <span class="keyword">END</span> make_a_string;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_an_info_msg (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> make_a_string (c_info_msg, status_in);</span><br><span class="line">    <span class="keyword">END</span> make_an_info_msg;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_a_warning (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> make_a_string (c_warning, status_in);</span><br><span class="line">    <span class="keyword">END</span> make_a_warning;</span><br><span class="line"></span><br><span class="line">    FUNCTION make_an_error (status_in IN VARCHAR2)</span><br><span class="line">        RETURN VARCHAR2</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">RETURN</span> make_a_string (c_error, status_in);</span><br><span class="line">    <span class="keyword">END</span> make_an_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_a_warning (status_inout IN OUT VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        status_inout := make_a_warning (status_inout);</span><br><span class="line">    <span class="keyword">END</span> make_a_warning;</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_an_error (status_inout IN OUT VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        status_inout := make_an_error (status_inout);</span><br><span class="line">    <span class="keyword">END</span> make_an_error;</span><br><span class="line"></span><br><span class="line">    PROCEDURE make_an_info_msg (status_inout IN OUT VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        status_inout := make_an_info_msg (status_inout);</span><br><span class="line">    <span class="keyword">END</span> make_an_info_msg;</span><br><span class="line"></span><br><span class="line">    FUNCTION log_entries_after (timestamp_in IN DATE)</span><br><span class="line">        RETURN SYS_REFCURSOR</span><br><span class="line">    IS</span><br><span class="line">        CV   SYS_REFCURSOR;</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        <span class="keyword">IF</span> trace_enabled</span><br><span class="line">        <span class="keyword">THEN</span></span><br><span class="line">            <span class="keyword">trace</span> (<span class="string">'log_entries_after for date'</span>, timestamp_in, <span class="literal">TRUE</span>);</span><br><span class="line">        <span class="keyword">END</span> <span class="keyword">IF</span>;</span><br><span class="line"></span><br><span class="line">        OPEN CV FOR</span><br><span class="line">            <span class="keyword">SELECT</span> full_log_string (<span class="keyword">context</span>, <span class="built_in">text</span>, <span class="literal">NULL</span>)</span><br><span class="line">              <span class="keyword">FROM</span> q$<span class="keyword">log</span> ql</span><br><span class="line">            <span class="comment">/* WHERE BM2066 return all rows for now</span></span><br><span class="line"><span class="comment">             ql.created_on &gt;= timestamp_in*/</span></span><br><span class="line">            <span class="keyword">ORDER</span> <span class="keyword">BY</span> ql.id;</span><br><span class="line"></span><br><span class="line">        RETURN CV;</span><br><span class="line">    <span class="keyword">END</span> log_entries_after;</span><br><span class="line"></span><br><span class="line">    PROCEDURE not_yet_implemented (program_name_in IN VARCHAR2)</span><br><span class="line">    IS</span><br><span class="line">    <span class="keyword">BEGIN</span></span><br><span class="line">        DBMS_OUTPUT.put_line (</span><br><span class="line">            <span class="string">'Callstack that found its way to "'</span> || program_name_in || <span class="string">'"'</span>);</span><br><span class="line">        DBMS_OUTPUT.put_line (DBMS_UTILITY.format_call_stack);</span><br><span class="line">        raise_application_error (</span><br><span class="line">            c_not_yet_implemented</span><br><span class="line">           ,   'Program named "'</span><br><span class="line">            || program_name_in</span><br><span class="line">            || '" has not yet been implemented.'</span><br><span class="line">            || ' Enable SERVEROUTPUT to see callstack for this program call.<span class="string">');</span></span><br><span class="line"><span class="string">    END not_yet_implemented;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE discard_error_state</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        g_discard_error_state := TRUE;</span></span><br><span class="line"><span class="string">        /*fds: 1.4.1 - discard_error_state: clear state already stored */</span></span><br><span class="line"><span class="string">        g_error_instance_raised := NULL;</span></span><br><span class="line"><span class="string">        clear_gcontexts;</span></span><br><span class="line"><span class="string">    END discard_error_state;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE keep_error_state</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        g_discard_error_state := FALSE;</span></span><br><span class="line"><span class="string">    END keep_error_state;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    FUNCTION error_state_discarded</span></span><br><span class="line"><span class="string">        RETURN BOOLEAN</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        RETURN g_discard_error_state;</span></span><br><span class="line"><span class="string">    END error_state_discarded;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">    PROCEDURE clean_up_errors (older_than_in IN DATE DEFAULT NULL)</span></span><br><span class="line"><span class="string">    IS</span></span><br><span class="line"><span class="string">        PRAGMA AUTONOMOUS_TRANSACTION;</span></span><br><span class="line"><span class="string">    BEGIN</span></span><br><span class="line"><span class="string">        DELETE FROM q$error_instance</span></span><br><span class="line"><span class="string">         WHERE older_than_in IS NULL OR created_on &lt;= older_than_in;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">        COMMIT;</span></span><br><span class="line"><span class="string">    END clean_up_errors;</span></span><br><span class="line"><span class="string">END q$error_manager;</span></span><br><span class="line"><span class="string">/</span></span><br></pre></td></tr></table></figure>
<h2 id="自定义错误"><a href="#自定义错误" class="headerlink" title="自定义错误"></a>自定义错误</h2><blockquote>
<p><code>qem$define_errors.sql</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">| This program is a part of the Quest Error Manager for Oracle.</span></span><br><span class="line"><span class="comment">| This product is freeware and is not supported by Quest.</span></span><br><span class="line"><span class="comment">|</span></span><br><span class="line"><span class="comment">| You may copy and change the data in these statements to meet</span></span><br><span class="line"><span class="comment">| your own application-specific requirements. That is, you can</span></span><br><span class="line"><span class="comment">| define your own errors in this script.</span></span><br><span class="line"><span class="comment">|</span></span><br><span class="line"><span class="comment">| www.quest.com</span></span><br><span class="line"><span class="comment">| </span></span><br><span class="line"><span class="comment">| Copyright, Quest Software, Inc, 2007</span></span><br><span class="line"><span class="comment">| All rights reserved</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">DECLARE</span></span><br><span class="line">   c_support   <span class="keyword">CONSTANT</span> VARCHAR2 (<span class="number">32767</span>)</span><br><span class="line">                        := <span class="string">'&lt;PUT IN YOUR OWN "CONTACT SUPPORT" MESSAGE HERE&gt;'</span>;</span><br><span class="line"></span><br><span class="line">   PROCEDURE ins (</span><br><span class="line">      error_category_name_in IN VARCHAR2</span><br><span class="line">    , code_in IN NUMBER DEFAULT NULL</span><br><span class="line">    , NAME_IN IN VARCHAR2 DEFAULT NULL</span><br><span class="line">    , description_in IN VARCHAR2 DEFAULT NULL</span><br><span class="line">    , substitute_string_in IN VARCHAR2 DEFAULT NULL</span><br><span class="line">    , recommendation_in IN VARCHAR2 DEFAULT NULL</span><br><span class="line">   )</span><br><span class="line">   IS</span><br><span class="line">   <span class="keyword">BEGIN</span></span><br><span class="line">      <span class="keyword">INSERT</span> <span class="keyword">INTO</span> q$<span class="keyword">error</span></span><br><span class="line">                  (<span class="keyword">ID</span>, error_category_name, code</span><br><span class="line">                 , <span class="keyword">NAME</span>, description, substitute_string</span><br><span class="line">                 , recommendation</span><br><span class="line">                  )</span><br><span class="line">           <span class="keyword">VALUES</span> (q$error_seq.NEXTVAL, error_category_name_in, code_in</span><br><span class="line">                 , NAME_IN, description_in, substitute_string_in</span><br><span class="line">                 , recommendation_in</span><br><span class="line">                  );</span><br><span class="line">   EXCEPTION</span><br><span class="line">      WHEN DUP_VAL_ON_INDEX</span><br><span class="line">      THEN</span><br><span class="line">         <span class="comment">/* Running install over existing install. Just ignore. */</span></span><br><span class="line">         NULL;</span><br><span class="line">   <span class="keyword">END</span> ins;</span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; <span class="string">'GENERAL ADMINISTRATION'</span></span><br><span class="line">     , code_in                     =&gt; <span class="number">10000001</span></span><br><span class="line">     , NAME_IN                     =&gt; <span class="string">'ASSERTION-FAILURE'</span></span><br><span class="line">     , description_in              =&gt; <span class="string">'This exception is raised when you:</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">*  call q$error_manager.assert</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">* pass it a Boolean expression that evaluates to FALSE or NULL</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">* and do not provide a specific error code or name to be raised for you.</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">There are no pre-defined context values used in the error message. Instead, if you set any name-value pairs when you call q$error_manager.assert, these will be displayed.'</span></span><br><span class="line">     , recommendation_in           =&gt; <span class="string">''</span></span><br><span class="line">     , substitute_string_in        =&gt; <span class="string">'The Boolean expression provided evaluated to FALSE or NULL. The condition checked by the assertion program has failed.'</span></span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'GENERAL ADMINISTRATION'</span><br><span class="line">     , code_in                     =&gt; 10000003</span><br><span class="line">     , NAME_IN                     =&gt; 'DEPRECATED-FUNCTIONALITY'</span><br><span class="line">     , description_in              =&gt; 'The user tried to run a program that has been deprecated.'</span><br><span class="line">     , recommendation_in           =&gt; 'This is NOT a user error. '</span><br><span class="line">                                      || c_support</span><br><span class="line">     , substitute_string_in        =&gt; 'The application attempted to run a program named "$program_name" that has been deprecated; that is, it is no longer available and should not be executed.'</span><br><span class="line">      );</span><br><span class="line">   ins (error_category_name_in      =&gt; 'GENERAL ADMINISTRATION'</span><br><span class="line">      , code_in                     =&gt; 10000000</span><br><span class="line">      , NAME_IN                     =&gt; 'NOEXCEPTION'</span><br><span class="line">      , description_in              =&gt; 'No exception has been raised.'</span><br><span class="line">      , recommendation_in           =&gt; ''</span><br><span class="line">      , substitute_string_in        =&gt; c_support</span><br><span class="line">       );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'GENERAL ADMINISTRATION'</span><br><span class="line">     , code_in                     =&gt; 10000002</span><br><span class="line">     , NAME_IN                     =&gt; 'UNANTICIPATED-ERROR'</span><br><span class="line">     , description_in              =&gt; 'This exception should be used in a PL/SQL WHEN OTHERS clause or other similar ''catch all'' handler for errors. You could not in advance know that this error was raised, and therefore could not handle it specifically. Instead, you will pass as much information possible and hope that the user or tester can figure out the problem.'</span><br><span class="line">     , recommendation_in           =&gt;    'If you cannot figure out the cause of the difficulty, '</span><br><span class="line">                                      || c_support</span><br><span class="line">     , substitute_string_in        =&gt; 'An unanticipated error has occurred. Please review the information below and see if it will help you resolve the problem.'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -2290</span><br><span class="line">     , NAME_IN                     =&gt; 'CHECK-CONSTRAINT-FAILURE'</span><br><span class="line">     , description_in              =&gt; 'A check constraint failed.'</span><br><span class="line">     , recommendation_in           =&gt; 'Determine the logic of the constraint and change the data so that it will not fail.'</span><br><span class="line">     , substitute_string_in        =&gt; 'The constaint named $constaint_name, defined on table $table_name and owned by $owner, failed. This means that a rule that was defined on this table was violated in the process of inserting or updating a row of data.'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -1400</span><br><span class="line">     , NAME_IN                     =&gt; 'COLUMN-CANNOT-BE-NULL'</span><br><span class="line">     , description_in              =&gt; 'The column has been defined to be NOT NULL, yet a DML operation attempted to set it to NULL.'</span><br><span class="line">     , recommendation_in           =&gt;    'If you can change the value to something that is not blank, do so. If this is not under your control, '</span><br><span class="line">                                      || c_support</span><br><span class="line">     , substitute_string_in        =&gt; 'You have tried to set the column $COLUMN_NAME of table $OWNER.$TABLE_NAME to NULL or a blank line; this is not allowed.'</span><br><span class="line">      );</span><br><span class="line"></span><br><span class="line">   <span class="comment">/* V1.2.11 Error number is changed to -1. Remove existing row. */</span></span><br><span class="line">   <span class="keyword">DELETE</span> <span class="keyword">FROM</span> q$<span class="keyword">error</span></span><br><span class="line">         <span class="keyword">WHERE</span> <span class="keyword">name</span> = <span class="string">'DUPLICATE-VALUE'</span>;</span><br><span class="line"></span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -1</span><br><span class="line">     , NAME_IN                     =&gt; 'DUPLICATE-VALUE'</span><br><span class="line">     , description_in              =&gt; 'A duplicate value on index error (ORA-00001) was raised for an insert or update'</span><br><span class="line">     , recommendation_in           =&gt; 'This means that either the primary key is a repeated value, which is almost certainly a software error, or you are repeating a value in a column that must be unique. For example, in many applications the NAME will be unique. Perhaps you entered a name that is already in use.'</span><br><span class="line">     , substitute_string_in        =&gt; 'We tried to insert or update a row of data, and ran into the following problem: at least one of the values are already in the database and you are not allowed to have duplicates.</span><br><span class="line"></span><br><span class="line">This error occurred on the table named $table_name, which is owned by $owner. The name of this unique constraint is $constraint_name. In some cases, we may be able to also display the columns and values that triggered the conflict. If available, they follow below.'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -2266</span><br><span class="line">     , NAME_IN                     =&gt; 'EXISTING-FKY-REFERENCE'</span><br><span class="line">     , description_in              =&gt; 'An DROP TABLE, TRUNCATE TABLE or DELETE statement attempted to remove a row in which the primary key or unique values are referenced by the foreign key value in another table.'</span><br><span class="line">     , recommendation_in           =&gt; c_support</span><br><span class="line">     , substitute_string_in        =&gt; 'We were unable to remove a row from table $owner.$table because it contains a primary key or unique value that is referenced by the foreign key value in another table.'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -24381</span><br><span class="line">     , NAME_IN                     =&gt; 'FORALL-INSERT-FAILURE'</span><br><span class="line">     , description_in              =&gt; 'An error occurred while performing a bulk insert operation.'</span><br><span class="line">     , recommendation_in           =&gt; ''</span><br><span class="line">     , substitute_string_in        =&gt; 'An attempt to perform a FORALL on table $TABLE_NAME failed. The incoming array had $ROW_COUNT'' rows in it. The last action taken during that procedure''s execution was:</span><br><span class="line"></span><br><span class="line">$PROGRESS_INDICATOR'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; -2291</span><br><span class="line">     , NAME_IN                     =&gt; 'INTEGRITY-CONSTRAINT-FAILURE'</span><br><span class="line">     , description_in              =&gt; 'An integrity constraint (primary key, foreign key, etc.) failed.'</span><br><span class="line">     , recommendation_in           =&gt;    'Make sure that you are entering data correctly. If that seems to be the case, '</span><br><span class="line">                                      || c_support</span><br><span class="line">     , substitute_string_in        =&gt; 'The constraint named $constraint_name, defined on table $table_name and owned by $owner, failed.'</span><br><span class="line">      );</span><br><span class="line">   ins</span><br><span class="line">      (error_category_name_in      =&gt; 'DML ERRORS'</span><br><span class="line">     , code_in                     =&gt; 10010008</span><br><span class="line">     , NAME_IN                     =&gt; 'SEQUENCE-GENERATION-FAILURE'</span><br><span class="line">     , description_in              =&gt; 'An attempt to generate a sequence with the next primary key function resulted in failure.'</span><br><span class="line">     , recommendation_in           =&gt; 'Make sure the sequence exists and that you have the authority necessary (SELECT) to obtain the next value from this sequence.'</span><br><span class="line">     , substitute_string_in        =&gt; 'An attempt to obtain the next sequence value from $sequence failed.'</span><br><span class="line">      );</span><br><span class="line">   <span class="keyword">COMMIT</span>;</span><br><span class="line"><span class="keyword">END</span>;</span><br><span class="line">/</span><br></pre></td></tr></table></figure>
<h2 id="卸载"><a href="#卸载" class="headerlink" title="卸载"></a>卸载</h2><blockquote>
<p><code>qem$uninstall.sql</code></p>
</blockquote>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">| This program is a part of the Quest Error Manager for Oracle.</span></span><br><span class="line"><span class="comment">| This product is freeware and is not supported by Quest.</span></span><br><span class="line"><span class="comment">| </span></span><br><span class="line"><span class="comment">| www.quest.com</span></span><br><span class="line"><span class="comment">| </span></span><br><span class="line"><span class="comment">| Copyright, Quest Software, Inc, 2007</span></span><br><span class="line"><span class="comment">| All rights reserved</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">SEQUENCE</span> q$error_seq</span><br><span class="line">/</span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">SEQUENCE</span> q$log_seq</span><br><span class="line">/</span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">SEQUENCE</span> q$error_context_seq</span><br><span class="line">/</span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">SEQUENCE</span> q$error_instance_seq</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">TABLE</span> q$error_context</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">TABLE</span> q$error_instance</span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">TABLE</span> q$<span class="keyword">error</span></span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">TABLE</span> q$<span class="keyword">log</span></span><br><span class="line">/</span><br><span class="line"></span><br><span class="line"><span class="keyword">DROP</span> <span class="keyword">PACKAGE</span> q$error_manager</span><br><span class="line">/</span><br></pre></td></tr></table></figure>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2019-04-12T09:42:14.470Z" itemprop="dateUpdated">2019-04-12 17:42:14</time>
</span><br>


        
        原文链接：<a href="/2018/04/17/qem-manual/" target="_blank" rel="external">https://betgar.github.io/2018/04/17/qem-manual/</a>
        
    </div>
    
    <footer>
        <a href="https://betgar.github.io">
            <img src="/img/avatar.jpg" alt="俊男">
            俊男
        </a>
    </footer>
</blockquote>

        


        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Oracle/">Oracle</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/PLSQL/">PLSQL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/qem/">qem</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://betgar.github.io/2018/04/17/qem-manual/&title=《qem-manual(使用手册)》 — 个人博客&pic=https://betgar.github.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://betgar.github.io/2018/04/17/qem-manual/&title=《qem-manual(使用手册)》 — 个人博客&source=各种技术加身的coder" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://betgar.github.io/2018/04/17/qem-manual/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《qem-manual(使用手册)》 — 个人博客&url=https://betgar.github.io/2018/04/17/qem-manual/&via=https://betgar.github.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://betgar.github.io/2018/04/17/qem-manual/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2018/04/19/jquery-best-practice/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">jQuery最佳实践</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2018/04/16/oracle-bind-variable/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">Oracle 绑定变量(bind variable)</h4>
      </a>
    </div>
  
</nav>



    











    <!-- Valine Comments -->
    <div class="comments vcomment" id="comments"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
    <!-- Valine Comments script -->
    <script>
        var GUEST_INFO = ['nick','mail','link'];
        var guest_info = 'nick,mail,link'.split(',').filter(function(item){
          return GUEST_INFO.indexOf(item) > -1
        });
        new Valine({
            el: '#comments',
            notify: 'false' == 'true',
            verify: 'false' == 'true',
            appId: "kiGWA9mdoVtQlfGYA5uDBNX7-gzGzoHsz",
            appKey: "dHCOdD0oEIjJd0cJoAHHN0y3",
            avatar: "mm",
            placeholder: "Just comment it",
            guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
            pageSize: "10"
        })
    </script>
    <!-- Valine Comments end -->







</article>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style="display:none">
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style="display:none">
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>俊男 &copy; 2017 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://betgar.github.io/2018/04/17/qem-manual/&title=《qem-manual(使用手册)》 — 个人博客&pic=https://betgar.github.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://betgar.github.io/2018/04/17/qem-manual/&title=《qem-manual(使用手册)》 — 个人博客&source=各种技术加身的coder" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://betgar.github.io/2018/04/17/qem-manual/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《qem-manual(使用手册)》 — 个人博客&url=https://betgar.github.io/2018/04/17/qem-manual/&via=https://betgar.github.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://betgar.github.io/2018/04/17/qem-manual/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>





</body>
</html>
